Browse Source

Merge branch 'dev' into pre-production

newStockUp
zhenghaoyu 1 year ago
parent
commit
030bf354f4
  1. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java
  2. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java
  3. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml
  4. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java
  5. 15
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java
  6. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  7. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java
  8. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml
  9. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.java
  10. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml
  11. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockService.java
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java
  13. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  14. 56
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  15. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java
  16. 164
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  17. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAreaController.java

@ -214,6 +214,19 @@ public class BasicdataGoodsAreaController extends BladeController {
}
/**
* 仓库 自定义分页
*/
@GetMapping("/getStockUpArea")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入warehouseWarehouse")
public R getStockUpArea(BasicdataGoodsAreaEntity warehouseWarehouse) {
// List<BasicdataGoodsAreaVO> pages = basicdataGoodsAreaService.stockUp(warehouseWarehouse);
R result = basicdataGoodsAreaService.getStockUpArea();
return result;
}
/**
* 导出数据
*/

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.java

@ -80,4 +80,11 @@ public interface BasicdataGoodsAreaMapper extends BaseMapper<BasicdataGoodsAreaE
List<BasicdatavisualizationSheetTwo> exportWarehouseByallocation(@Param("areaId") Long areaId);
List<BasicdatavisualizationSheetThree> exportWarehouseByStrip(@Param("areaId") Long areaId);
/**
* 查询仓库下的备货区
* @param department
* @return
*/
List<BasicdataGoodsAreaVO> selectStockUpArea(@Param("id")Long id,@Param("department") Long department);
}

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAreaMapper.xml

@ -242,4 +242,12 @@
ldpl.warehouse_id =#{areaId}
</where>
</select>
<select id="selectStockUpArea" resultType="com.logpm.basicdata.vo.BasicdataGoodsAreaVO">
select wga.id, wga.headline, wga.enable_status, wga.area_type, ww.name
from logpm_warehouse_goods_area wga
left JOIN logpm_warehouse_warehouse ww on wga.warehouse_id = ww.id
where wga.warehouse_id in (select id from logpm_warehouse_warehouse where department = #{department} AND id = #{id})
and wga.area_type = 1
and wga.enable_status = 1
</select>
</mapper>

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAreaService.java

@ -119,4 +119,10 @@ public interface IBasicdataGoodsAreaService extends BaseService<BasicdataGoodsAr
*/
void visualizationwarehouse(Long areaId, HttpServletResponse response);
/**
* 查询当前操作人仓库下的备货区信息
* @return
*/
R getStockUpArea();
}

15
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java

@ -369,6 +369,21 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl<BasicdataGood
//return warehouseGoodsAreaList;
}
@Override
public R getStockUpArea() {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseService.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
log.error("#########当前仓库信息错误:{}",myCurrentWarehouse);
return R.fail("无仓库信息!!!");
}
if (Func.isEmpty(myCurrentWarehouse.getDepartment())){
log.error("#########当前仓库部门信息错误:{}",myCurrentWarehouse.getDepartment());
return R.fail("仓库无部门信息!!!");
}
List<BasicdataGoodsAreaVO> goodsAreaVOS = baseMapper.selectStockUpArea(myCurrentWarehouse.getId(),myCurrentWarehouse.getDepartment());
return R.data(goodsAreaVOS);
}
public String countUniqueProperties(String initial){

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

@ -169,8 +169,15 @@
LEFT JOIN logpm_distribution_stock lds on lds.parcel_list_id = ldpl.id
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id
<where>
ldpl.stock_article_id = #{param.stockArticleId}
<if test="param.allocationId != null and param.allocationId != ''"> and lwug.allocation_id = #{param.allocationId} </if>
<if test="param.stockArticleId != null and param.stockArticleId != ''"> and ldpl.stock_article_id = #{param.stockArticleId} </if>
<if test="param.stockArticleIdList != null ">
and ldpl.stock_article_id in
<foreach collection="param.stockArticleIdList" separator="," open="(" close=")" item="a" >
#{a}
</foreach>
</if>
</where>
</select>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java

@ -79,4 +79,5 @@ public interface DistributionStockMapper extends BaseMapper<DistributionStockEnt
DistributionStockVO selectStockupInfoSelf(@Param("pageId")Long pageId);
DistributionStockAllocationVO selectAllocation(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId,@Param("parcelListId") Long parcelListId);
DistributionStockAllocationVO selectSelfAllocation(@Param("reservationId") Long reservationId,@Param("stockupId") Long stockupId,@Param("parcelListId") Long parcelListId);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.xml

@ -99,11 +99,19 @@
<select id="selectAllocation" resultType="com.logpm.distribution.vo.DistributionStockAllocationVO">
select lwugl.position_code,lwugl.allocation_id
from logpm_distribution_stock lds
LEFT JOIN logpm_warehouse_updown_goods_log lwugl on lds.parcel_list_id = lwugl.association_id and lwugl.binding_type = 2
LEFT JOIN logpm_warehouse_updown_goods_log lwugl on lds.parcel_list_id = lwugl.association_id and lwugl.binding_type = 2 and lwugl.create_time >= DATE_SUB(NOW(), INTERVAL 1 HOUR)
where lds.reservation_id = #{reservationId} and lds.stockup_id = #{stockupId} and lds.parcel_list_id = #{parcelListId}
GROUP BY lwugl.create_time ,lwugl.position_code,lwugl.allocation_id
LIMIT 1
</select>
<select id="selectSelfAllocation" resultType="com.logpm.distribution.vo.DistributionStockAllocationVO">
select lwugl.position_code,lwugl.allocation_id
from logpm_distribution_stock lds
LEFT JOIN logpm_warehouse_updown_goods_log lwugl on lds.parcel_list_id = lwugl.association_id and lwugl.binding_type = 2 and lwugl.create_time >= DATE_SUB(NOW(), INTERVAL 1 HOUR)
where lds.bill_lading_id = #{reservationId} and lds.stockup_id = #{stockupId} and lds.parcel_list_id = #{parcelListId}
GROUP BY lwugl.create_time ,lwugl.position_code,lwugl.allocation_id
LIMIT 1
</select>
</mapper>

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

@ -59,9 +59,9 @@ public interface DistrilbutionBillStockMapper extends BaseMapper<DistrilbutionBi
List<DistributionStockupOrderListVO> selectDistrilbutionBillSelf(@Param("reservationId")Long reservationId);
DistributionStockupSelfVO selectDistrilbutionBillPackSelf(@Param("param") StockupDTO stockupDTO);
List<DistributionStockupSelfVO> selectDistrilbutionBillPackSelf(@Param("param") StockupDTO stockupDTO);
DistributionStockupSelfVO selectDistrilbutionBillPackWuSelf(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId);
List<DistributionStockupSelfVO> selectDistrilbutionBillPackWuSelf(@Param("reservationId")Long reservationId,@Param("stockupId") Long stockupId);
DistributionStockupSelfVO selectDistrilbutionBillOverPackWuSelf(@Param("param")StockupDTO stockupDTO);
}

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

@ -11,13 +11,13 @@
select * from logpm_distrilbution_bill_stock where is_deleted = 0
</select>
<select id="selectDistrilbutionBillPackSelf" resultType="com.logpm.distribution.vo.DistributionStockupSelfVO">
select
select DISTINCT
(
SELECT COUNT(lwug.id)
FROM logpm_distribution_parcel_list lpl
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = lpl.id
where
lpl.stock_article_id = ldbs.stock_article_id and lwug.allocation_id = #{param.allocationId}
lwug.allocation_id = #{param.allocationId}
) planNum ,(
SELECT COUNT(lt.id)
FROM logpm_distribution_stock lt

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

@ -84,4 +84,12 @@ public interface IDistributionStockService extends BaseService<DistributionStock
* @return
*/
DistributionStockAllocationVO selectAllocation(Long reservationId, Long stockupId, Long parcelListId);
/**
* 查询有无配货历史货位
* @param reservationId
* @param stockupId
* @param parcelListId
* @return
*/
DistributionStockAllocationVO selectSelfAllocation(Long reservationId, Long stockupId, Long parcelListId);
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillStockService.java

@ -70,9 +70,9 @@ public interface IDistrilbutionBillStockService extends BaseService<Distrilbutio
*
* @param stockupDTO@return
*/
DistributionStockupSelfVO selectDistrilbutionBillPackSelf(StockupDTO stockupDTO);
List<DistributionStockupSelfVO> selectDistrilbutionBillPackSelf(StockupDTO stockupDTO);
DistributionStockupSelfVO selectDistrilbutionBillPackWuSelf(Long reservationId, Long stockupId);
List<DistributionStockupSelfVO> selectDistrilbutionBillPackWuSelf(Long reservationId, Long stockupId);
DistributionStockupSelfVO selectDistrilbutionBillOverPackWuSelf(StockupDTO stockupDTO);
}

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

@ -3263,7 +3263,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
map.put("配送时间",taskTime);//配送时间
map.put("承运商",deliveryListEntity.getDistributionCompany());
map.put("配送仓库",deliveryListEntity.getWarehouseName());
map.put("出库时间",deliveryListEntity.getWarehouseName());
map.put("出库时间",taskTime);
map.put("送货司机",dirverName+"/"+dirverPhone);
map.put("车牌号",carNumber);

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

@ -651,8 +651,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionStockupEntity stockupEntity = new DistributionStockupEntity();
BladeUser user = AuthUtil.getUser();
stockupEntity.setStockupUser(user.getUserName());
stockupEntity.setStockupArea(stockupAreaName);
stockupEntity.setGoodsAreaId(Long.parseLong(goddsAreaId));
if (Func.isNotEmpty(goddsAreaId)){
stockupEntity.setStockupArea(stockupAreaName);
stockupEntity.setGoodsAreaId(Long.parseLong(goddsAreaId));
}
//编码生成规则 BH+仓库编码+年月日+序号00001
stockupEntity.setStockupCode(bianMa());
//设置备货任务指派状态---未指派
@ -669,26 +671,38 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
result = distributionStockupService.save(stockupEntity);
Long id = stockupEntity.getId();
List<Long> reservationIds = Func.toLongList(ids);
for (Long reservationId : reservationIds) {
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId);
if (Func.isEmpty(reservationEntity) || !reservationEntity.getReservationStatus().equals("20")) {
log.error("reservationEntity参数异常:+{" + reservationEntity + "}");
return R.fail("预约信息状态异常!!!");
}
//修改预约备货状态
reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
result = SqlHelper.retBool(distributionReservationMapper.updateById(reservationEntity));
//构建中间表信息
DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity();
reservationStockupEntity.setStockupId(id);
reservationStockupEntity.setStockUpType(StockupTypeConstant.shipei.getValue());
reservationStockupEntity.setReservationId(reservationEntity.getId());
result = distributionStockupInfoService.save(reservationStockupEntity);
if (!result) {
log.error("sql执行异常:+{" + result + "}");
return R.fail("请稍后再试");
}
List<DistributionReservationEntity> reservationEntityList = distributionReservationMapper.selectList(Wrappers.<DistributionReservationEntity>query().lambda().in(DistributionReservationEntity::getId, reservationIds));
if (Func.isNotEmpty(reservationEntityList)){
reservationEntityList.forEach(r->{
r.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
distributionReservationMapper.updateById(r);
DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity();
reservationStockupEntity.setStockupId(id);
reservationStockupEntity.setStockUpType(StockupTypeConstant.shipei.getValue());
reservationStockupEntity.setReservationId(r.getId());
distributionStockupInfoService.save(reservationStockupEntity);
});
}
// for (Long reservationId : reservationIds) {
// DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(reservationId);
// if (Func.isEmpty(reservationEntity) || !reservationEntity.getReservationStatus().equals("20")) {
// log.error("reservationEntity参数异常:+{" + reservationEntity + "}");
// return R.fail("预约信息状态异常!!!");
// }
// //修改预约备货状态
// reservationEntity.setStockupStatus(ReservationStockupStatusConstant.daibeihuo.getValue());
// result = SqlHelper.retBool(distributionReservationMapper.updateById(reservationEntity));
// //构建中间表信息
// DistributionStockupInfoEntity reservationStockupEntity = new DistributionStockupInfoEntity();
// reservationStockupEntity.setStockupId(id);
// reservationStockupEntity.setStockUpType(StockupTypeConstant.shipei.getValue());
// reservationStockupEntity.setReservationId(reservationEntity.getId());
// result = distributionStockupInfoService.save(reservationStockupEntity);
// if (!result) {
// log.error("sql执行异常:+{" + result + "}");
// return R.fail("请稍后再试");
// }
// }
} catch (ParseException e) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
log.error("执行异常:+{" + e.getMessage() + "}");

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockServiceImpl.java

@ -335,4 +335,9 @@ public class DistributionStockServiceImpl extends BaseServiceImpl<DistributionSt
return baseMapper.selectAllocation(reservationId,stockupId,parcelListId);
}
@Override
public DistributionStockAllocationVO selectSelfAllocation(Long reservationId, Long stockupId, Long parcelListId) {
return baseMapper.selectSelfAllocation(reservationId,stockupId,parcelListId);
}
}

164
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -65,7 +65,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.function.Predicate;
@ -515,9 +514,17 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
y.setScanNum(y.getScanNum()+1);
}
//t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(i.getTrayId())){
if(ObjectUtils.isNotNull(y.getTrayId()) && !y.getTrayId().equals(i.getTrayId())){
y.setPallet(y.getPallet()+","+i.getPallet());
}
//订单自编号信息
if(ObjectUtils.isNotNull(y.getOrderCode()) && !y.getOrderCode().equals(i.getOrderCode())){
y.setOrderCode(y.getOrderCode()+","+i.getOrderCode());
}
//订单Id信息
if(ObjectUtils.isNotNull(y.getStockArticleId()) && !y.getStockArticleId().equals(i.getStockArticleId())){
y.setStockArticleId(y.getStockArticleId()+","+i.getStockArticleId());
}
}
} );
}else{
@ -542,23 +549,50 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} );
//获取没有货位的数据
List<DistributionStockupOrderListVO> collect22 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());
List<DistributionStockupOrderListVO> listLi = new ArrayList<>(); //历史
if(!collect22.isEmpty()){
collect22.forEach( i -> {
boolean b = listYou.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getAllocationId()));
DistributionStockAllocationVO stockAllocationVO = distributionStockService.selectSelfAllocation(stockupDTO.getReservationId(),stockupDTO.getStockupId(),i.getParcelListId());
if(ObjectUtils.isNotNull(stockAllocationVO)){
//添加以扫货位信息
i.setAllocation(stockAllocationVO.getPositionCode());
i.setAllocationId(stockAllocationVO.getAllocationId());
listLi.add(i);
}else{
listLi.add(i);
}
});
}
List<DistributionStockupOrderListVO> collectY = listLi.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());
List<DistributionStockupOrderListVO> collectW = listLi.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());
//有
if(!collectY.isEmpty()){
collectY.forEach( i -> {
boolean b = listYou.stream().anyMatch(ii ->ii.getAllocationId().equals(i.getAllocationId()));
if(b){
listYou.forEach( wu -> {
if(ObjectUtils.isNull(wu.getAllocationId())){
if(wu.getAllocationId().equals(i.getAllocationId())){
//相同
wu.setPlanNum(wu.getPlanNum()+1);
if(ObjectUtils.isNotNull(i.getStockId())){
wu.setScanNum(wu.getScanNum()+1);
}
//托盘信息
if(ObjectUtils.isNotNull(wu.getTrayId()) && wu.getTrayId().equals(i.getTrayId())){
if(ObjectUtils.isNotNull(wu.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){
wu.setPallet(wu.getPallet()+","+i.getPallet());
}
//订单自编号信息
if(ObjectUtils.isNotNull(wu.getOrderCode()) && !wu.getOrderCode().equals(i.getOrderCode())){
wu.setOrderCode(wu.getOrderCode()+","+i.getOrderCode());
}
//订单ID信息
if(ObjectUtils.isNotNull(wu.getStockArticleId()) && !wu.getStockArticleId().equals(i.getStockArticleId())){
wu.setStockArticleId(wu.getStockArticleId()+","+i.getStockArticleId());
}
if(wu.getPlanNum().equals(wu.getScanNum())){
wu.setCompleteStact(true);
}else{
wu.setCompleteStact(false);
}
}
});
@ -566,6 +600,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
i.setPlanNum(1);
if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(1);
i.setCompleteStact(true);
}else{
i.setScanNum(0);
}
@ -573,6 +608,48 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
});
}
collectW.forEach(i ->{
boolean b = listYou.stream().anyMatch(ko -> ObjectUtils.isNull(ko.getAllocationId()));
if(b){
listYou.forEach( wu -> {
if(ObjectUtils.isNull(wu.getAllocationId())){
//相同
wu.setPlanNum(wu.getPlanNum()+1);
if(ObjectUtils.isNotNull(i.getStockId())){
wu.setScanNum(wu.getScanNum()+1);
}
//托盘信息
if(ObjectUtils.isNotNull(wu.getTrayId()) && !wu.getTrayId().equals(i.getTrayId())){
wu.setPallet(wu.getPallet()+","+i.getPallet());
}
//订单自编号信息
if(ObjectUtils.isNotNull(wu.getOrderCode()) && !wu.getOrderCode().equals(i.getOrderCode())){
wu.setOrderCode(wu.getOrderCode()+","+i.getOrderCode());
}
//订单id信息
if(ObjectUtils.isNotNull(wu.getStockArticleId()) && !wu.getStockArticleId().equals(i.getStockArticleId())){
wu.setStockArticleId(wu.getStockArticleId()+","+i.getStockArticleId());
}
if(wu.getPlanNum().equals(wu.getScanNum())){
wu.setCompleteStact(true);
}else{
wu.setCompleteStact(false);
}
}
});
}else{
i.setPlanNum(1);
if(ObjectUtils.isNotNull(i.getStockId())){
i.setScanNum(1);
i.setCompleteStact(true);
}else{
i.setScanNum(0);
}
listYou.add(i);
}
});
// List<DistributionStockupOrderListVO> collect = list.stream().filter(o -> ObjectUtils.isNotNull(o.getAllocationId())).collect(Collectors.toList());//不为空
// List<DistributionStockupOrderListVO> collect2 = collect.stream().filter(distinctByKey(person -> person.getAllocationId())).collect(Collectors.toList()); //去重
// List<DistributionStockupOrderListVO> collect1 = list.stream().filter(o -> ObjectUtils.isNull(o.getAllocationId())).collect(Collectors.toList());//为空
@ -598,7 +675,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
y.setScanNum(y.getScanNum()+1);
}
//t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(p.getTrayId())){
if(ObjectUtils.isNotNull(y.getTrayId()) && !y.getTrayId().equals(p.getTrayId())){
y.setPallet(y.getPallet()+","+p.getPallet());
}
}
@ -655,7 +732,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
y.setScanNum(y.getScanNum()+1);
}
//t托盘信息
if(ObjectUtils.isNotNull(y.getTrayId()) && y.getTrayId().equals(p.getTrayId())){
if(ObjectUtils.isNotNull(y.getTrayId()) && !y.getTrayId().equals(p.getTrayId())){
y.setPallet(y.getPallet()+","+p.getPallet());
}
if(y.getPlanNum().equals(y.getScanNum())){
@ -878,10 +955,16 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
public DistributionStockupOrderInfoVO selectOrderInfoSelf(StockupDTO stockupDTO) {
DistributionStockArticleEntity byId = distributionStockArticleService.getById(stockupDTO.getStockArticleId());
if(stockupDTO.getStatus().equals(1)){
//已备货
DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillOverPackWuSelf(stockupDTO);
// DistributionStockupSelfVO distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId());
if(stockupDTO.getStockArticleId().contains(",")){
queryWrapper.in("stock_article_id", stockupDTO.getStockArticleId().split(","));
}else{
queryWrapper.eq("stock_article_id", stockupDTO.getStockArticleId());
}
if(!stockupDTO.getTypeService().equals("3")){
queryWrapper.eq("order_package_reservation_status", OrderPackageReservationStatusConstant.yiyueyue.getValue());
}
@ -926,12 +1009,71 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionStockupSelfVO distributionStockupSelfVO = new DistributionStockupSelfVO();
if(ObjectUtils.isNotNull(stockupDTO.getAllocationId())){
//查询订单数量 有库位
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO);
List<DistributionStockupSelfVO> distributionStockupSelfVOS = distrilbutionBillStockService.selectDistrilbutionBillPackSelf(stockupDTO);
DistributionStockupSelfVO distributionStockup= new DistributionStockupSelfVO();
AtomicReference<Integer> j = new AtomicReference<>(0);
AtomicReference<Integer> y = new AtomicReference<>(0);
distributionStockupSelfVOS.forEach(i -> {
j.updateAndGet(v -> v + i.getPlanNum());
y.updateAndGet(v -> v + i.getScanNum());
if(ObjectUtils.isNull(distributionStockup.getConsignee())){
distributionStockup.setConsignee(i.getConsignee());
}else{
if(ObjectUtils.isNotNull(i.getConsignee())){
String s = distributionStockup.getConsignee() + i.getConsignee();
distributionStockup.setConsignee(s);
}
}
if(ObjectUtils.isNull(distributionStockup.getTrays())){
distributionStockup.setTrays(i.getTrays());
}else{
if(ObjectUtils.isNotNull(i.getTrays())){
String s = distributionStockup.getTrays() + i.getTrays();
distributionStockup.setTrays(s);
}
}
});
distributionStockup.setPlanNum(j.get());
distributionStockup.setScanNum(y.get());
distributionStockupSelfVO = distributionStockup;
}else{
//查询订单数量 无库位
distributionStockupSelfVO = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
List<DistributionStockupSelfVO> distributionStockupSelfVOS = distrilbutionBillStockService.selectDistrilbutionBillPackWuSelf(stockupDTO.getReservationId(), stockupDTO.getStockupId());
DistributionStockupSelfVO distributionStockup= new DistributionStockupSelfVO();
AtomicReference<Integer> j = new AtomicReference<>(0);
AtomicReference<Integer> y = new AtomicReference<>(0);
distributionStockupSelfVOS.forEach(i -> {
j.updateAndGet(v -> v + i.getPlanNum());
y.updateAndGet(v -> v + i.getScanNum());
if(ObjectUtils.isNull(distributionStockup.getConsignee())){
distributionStockup.setConsignee(i.getConsignee());
}else{
if(ObjectUtils.isNotNull(i.getConsignee())){
String s = distributionStockup.getConsignee() + i.getConsignee();
distributionStockup.setConsignee(s);
}
}
if(ObjectUtils.isNull(distributionStockup.getTrays())){
distributionStockup.setTrays(i.getTrays());
}else{
if(ObjectUtils.isNotNull(i.getTrays())){
String s = distributionStockup.getTrays() + i.getTrays();
distributionStockup.setTrays(s);
}
}
});
distributionStockup.setPlanNum(j.get());
distributionStockup.setScanNum(y.get());
distributionStockupSelfVO = distributionStockup;
}
if(stockupDTO.getStockArticleId().contains(",")){
stockupDTO.setStockArticleIdList(stockupDTO.getStockArticleId().split(","));
stockupDTO.setStockArticleId(null);
}
// if(stockupDTO.getOrderCode().contains(",")){
// stockupDTO.setOrderCodeList(stockupDTO.getOrderCode().split(","));
// stockupDTO.setOrderCode(null);
// }
List<PackageStockupVO> list = distributionParcelListService.selectOrderInfoSelfList(stockupDTO);
Iterator<PackageStockupVO> iterator = list.iterator();

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java

@ -92,12 +92,12 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl<Distrilbu
* @param stockupDTO@return
*/
@Override
public DistributionStockupSelfVO selectDistrilbutionBillPackSelf(StockupDTO stockupDTO) {
public List<DistributionStockupSelfVO> selectDistrilbutionBillPackSelf(StockupDTO stockupDTO) {
return baseMapper.selectDistrilbutionBillPackSelf(stockupDTO);
}
@Override
public DistributionStockupSelfVO selectDistrilbutionBillPackWuSelf(Long reservationId, Long stockupId) {
public List<DistributionStockupSelfVO> selectDistrilbutionBillPackWuSelf(Long reservationId, Long stockupId) {
return baseMapper.selectDistrilbutionBillPackWuSelf(reservationId,stockupId);
}

Loading…
Cancel
Save