Browse Source

1.零担按品类逻辑代码优化

dist.1.2.0^2
zhenghaoyu 7 months ago
parent
commit
83e8459b55
  1. 53
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalRecordZeroDetailEntity.java
  2. 4
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java
  3. 44
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordZeroDetailClient.java
  4. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  5. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java
  6. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelListVO.java
  7. 14
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OrderCodeNumVO.java
  8. 11
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineScanZeroDetailVO.java
  9. 4
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadPackageVO.java
  10. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java
  11. 22
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordZeroDetailClient.java
  12. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordZeroDetailMapper.java
  13. 7
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAbnormalRecordZeroDetailService.java
  14. 16
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordZeroDetailServiceImpl.java
  15. 13
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  16. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java
  17. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  18. 15
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  19. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java
  20. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml
  21. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  22. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelNumberService.java
  23. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  24. 21
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java
  25. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java
  26. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  27. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  28. 7
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.java
  29. 21
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.xml
  30. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  31. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  32. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java
  33. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineScanZeroDetailService.java
  34. 54
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  35. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  36. 27
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  37. 446
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  38. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineScanZeroDetailServiceImpl.java

53
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalRecordZeroDetailEntity.java

@ -0,0 +1,53 @@
package com.logpm.aftersales.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
@Data
@TableName("logpm_aftersales_abnormal_record_zero_detail")
@ApiModel(value = "AftersalesAbnormalRecordZeroDetail对象", description = "异常记录零担明细表")
@EqualsAndHashCode(callSuper = true)
public class AftersalesAbnormalRecordZeroDetailEntity extends TenantEntity {
/** 预留1 */
@ApiModelProperty(name = "预留1",notes = "")
private String reserve1 ;
/** 预留2 */
@ApiModelProperty(name = "预留2",notes = "")
private String reserve2 ;
/** 预留3 */
@ApiModelProperty(name = "预留3",notes = "")
private String reserve3 ;
/** 预留4 */
@ApiModelProperty(name = "预留4",notes = "")
private String reserve4 ;
/** 预留5 */
@ApiModelProperty(name = "预留5",notes = "")
private String reserve5 ;
@ApiModelProperty(name = "异常记录id",notes = "")
private Long AbnormalRecordId;
@ApiModelProperty(name = "异常记录id",notes = "")
private Long packageId;
@ApiModelProperty(name = "品类id",notes = "")
private Long goodsId;
@ApiModelProperty(name = "品类名称",notes = "")
private String goodsName;
@ApiModelProperty(name = "异常数量",notes = "")
private Integer abnormalNum;
@ApiModelProperty(name = "回库数量",notes = "")
private Integer returnNum;
@ApiModelProperty(name = "入库数量",notes = "")
private Integer incomingNum;
}

4
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java

@ -58,4 +58,8 @@ public interface IAftersalesAbnormalRecordClient {
@PostMapping(API_PREFIX+"/addAbnormalRecordList")
void addAbnormalRecordList(@RequestBody List<AftersalesAbnormalRecordEntity> abnormalRecordEntities);
@PostMapping(API_PREFIX+"/addAbnormalRecordListReturnList")
List<AftersalesAbnormalRecordEntity> addAbnormalRecordListReturnList(@RequestBody List<AftersalesAbnormalRecordEntity> abnormalRecordEntities);
}

44
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordZeroDetailClient.java

@ -0,0 +1,44 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.aftersales.feign;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
* 货位 Feign接口类
*
* @author zhy
* @since 2023-09-02
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_AFTERSALES_NAME
)
public interface IAftersalesAbnormalRecordZeroDetailClient {
String API_PREFIX = "abormal/client";
String TOP = API_PREFIX + "/top";
@PostMapping(API_PREFIX+"/addAbnormalRecordZeroDetail")
void addAbnormalRecordZeroDetail(@RequestBody List<AftersalesAbnormalRecordZeroDetailEntity> abnormalRecordZeroDetailEntityList);
}

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -218,4 +218,9 @@ public interface IDistributionParcelListClient {
@GetMapping(API_PREFIX + "/findListByStockArticleId")
List<DistributionParcelListEntity> findListByStockArticleId(@RequestParam Long articleId);
@GetMapping(API_PREFIX + "/findEntityVOListByOrderCode")
List<DistributionParcelListVO> findEntityVOListByOrderCode(@RequestParam String orderCode, @RequestParam Long fromWarehouseId);
@GetMapping(API_PREFIX + "/addZeroQuantity")
void addZeroQuantity(@RequestParam Long packageId, @RequestParam int num);
}

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java

@ -54,4 +54,10 @@ public interface IDistributionParcelNumberClient {
@PostMapping(API_PREFIX + "/addBatch")
void addBatch(@RequestBody List<DistributionParcelNumberEntity> parcelNumberList);
@PostMapping(API_PREFIX + "/findListByParcelListIds")
List<DistributionParcelNumberEntity> findListByParcelListIds(@RequestBody List<Long> parcelListIds);
@PostMapping(API_PREFIX + "/updateList")
void updateList(@RequestBody List<DistributionParcelNumberEntity> updateParceNumberList);
}

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelListVO.java

@ -37,6 +37,8 @@ import java.util.List;
public class DistributionParcelListVO extends DistributionParcelListEntity {
private static final long serialVersionUID = 1L;
private Integer zeroPackageTotalNum;
private String stockupStatus; //备货状态
private String stockupStatusName; //备货名称
private Date stockupDate;

14
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/OrderCodeNumVO.java

@ -0,0 +1,14 @@
package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
@Data
public class OrderCodeNumVO implements Serializable {
private String orderCode;
private Integer totalNum;
}

11
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/TrunklineScanZeroDetailVO.java

@ -0,0 +1,11 @@
package com.logpm.trunkline.vo;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import lombok.Data;
@Data
public class TrunklineScanZeroDetailVO extends TrunklineScanZeroDetailEntity {
}

4
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/vo/UnloadPackageVO.java

@ -3,6 +3,8 @@ package com.logpm.trunkline.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class UnloadPackageVO implements Serializable {
@ -16,4 +18,6 @@ public class UnloadPackageVO implements Serializable {
private String scanStatus;
private String unloadNodeName;
private List<TrunklineScanZeroDetailVO> scanZeroDetailList = new ArrayList<>();
}

6
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java

@ -54,4 +54,10 @@ public class AftersalesAbnormalRecordClient implements IAftersalesAbnormalRecord
public void addAbnormalRecordList(List<AftersalesAbnormalRecordEntity> abnormalRecordEntities) {
aftersalesAbnormalRecordService.saveBatch(abnormalRecordEntities);
}
@Override
public List<AftersalesAbnormalRecordEntity> addAbnormalRecordListReturnList(List<AftersalesAbnormalRecordEntity> abnormalRecordEntities) {
aftersalesAbnormalRecordService.saveBatch(abnormalRecordEntities);
return abnormalRecordEntities;
}
}

22
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordZeroDetailClient.java

@ -0,0 +1,22 @@
package com.logpm.aftersales.feign;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import com.logpm.aftersales.service.IAftersalesAbnormalRecordZeroDetailService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
@ApiIgnore()
@RestController
@AllArgsConstructor
public class AftersalesAbnormalRecordZeroDetailClient implements IAftersalesAbnormalRecordZeroDetailClient {
private final IAftersalesAbnormalRecordZeroDetailService abnormalRecordZeroDetailService;
@Override
public void addAbnormalRecordZeroDetail(List<AftersalesAbnormalRecordZeroDetailEntity> abnormalRecordZeroDetailEntityList) {
abnormalRecordZeroDetailService.saveBatch(abnormalRecordZeroDetailEntityList);
}
}

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAbnormalRecordZeroDetailMapper.java

@ -0,0 +1,9 @@
package com.logpm.aftersales.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import org.mapstruct.Mapper;
@Mapper
public interface AftersalesAbnormalRecordZeroDetailMapper extends BaseMapper<AftersalesAbnormalRecordZeroDetailEntity> {
}

7
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesAbnormalRecordZeroDetailService.java

@ -0,0 +1,7 @@
package com.logpm.aftersales.service;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import org.springblade.core.mp.base.BaseService;
public interface IAftersalesAbnormalRecordZeroDetailService extends BaseService<AftersalesAbnormalRecordZeroDetailEntity> {
}

16
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordZeroDetailServiceImpl.java

@ -0,0 +1,16 @@
package com.logpm.aftersales.service.impl;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import com.logpm.aftersales.mapper.AftersalesAbnormalRecordZeroDetailMapper;
import com.logpm.aftersales.service.IAftersalesAbnormalRecordZeroDetailService;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
@Slf4j
public class AftersalesAbnormalRecordZeroDetailServiceImpl extends BaseServiceImpl<AftersalesAbnormalRecordZeroDetailMapper, AftersalesAbnormalRecordZeroDetailEntity> implements IAftersalesAbnormalRecordZeroDetailService {
}

13
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java

@ -516,4 +516,17 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return distributionParcelListService.list(queryWrapper);
}
@Override
public List<DistributionParcelListVO> findEntityVOListByOrderCode(String orderCode, Long fromWarehouseId) {
return distributionParcelListService.findEntityVOListByOrderCode(orderCode,fromWarehouseId);
}
@Override
public void addZeroQuantity(Long packageId, int num) {
//零担加了数量
distributionParcelListService.addZeroPackageQuantity(packageId,num);
//对应的parceNumber也要加上在库数量
distributionParcelNumberService.addZeroQuantity(packageId,num);
}
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java

@ -16,13 +16,14 @@
*/
package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -57,4 +58,16 @@ public class DistributionParcelNumberClient implements IDistributionParcelNumber
distributionParcelNumberService.saveBatch(parcelNumberList);
}
@Override
public List<DistributionParcelNumberEntity> findListByParcelListIds(List<Long> parcelListIds) {
QueryWrapper<DistributionParcelNumberEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("parcel_list_id", parcelListIds);
return distributionParcelNumberService.list(queryWrapper);
}
@Override
public void updateList(List<DistributionParcelNumberEntity> updateParceNumberList) {
distributionParcelNumberService.updateBatchById(updateParceNumberList);
}
}

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

@ -299,4 +299,8 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
void clearAllocationByIds(@Param("clearTrayList") List<Long> clearTrayList);
List<JSONObject> findPackageGoodsListByWaybillNo(@Param("waybillNo") String waybillNo);
List<DistributionParcelListVO> findEntityVOListByOrderCode(@Param("orderCode") String orderCode,@Param("fromWarehouseId") Long fromWarehouseId);
void addZeroPackageQuantity(@Param("packageId") Long packageId, @Param("num") int num);
}

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

@ -1884,5 +1884,20 @@
where lwwd.order_code = #{waybillNo}
</select>
<select id="findEntityVOListByOrderCode" resultType="com.logpm.distribution.vo.DistributionParcelListVO">
select ldpl.*,
lwwd.num zeroPackageTotalNum
from logpm_distribution_parcel_list ldpl
left join logpm_warehouse_waybill_detail lwwd on lwwd.id = ldpl.advanceId
where ldpl.order_code = #{orderCode}
and ldpl.warehouse_id = #{fromWarehouseId}
</select>
<update id="addZeroPackageQuantity" >
update logpm_distribution_parcel_list
set quantity = quantity + #{num}
where id = #{packageId}
</update>
</mapper>

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

@ -74,4 +74,6 @@ public interface DistributionParcelNumberMapper extends BaseMapper<DistributionP
* @return
*/
Integer augmentSignForNum(@Param("packageId") Long id,@Param("stockArticleId") Long stockArticleId,@Param("quantity") Integer quantity);
void addZeroQuantity(@Param("packageId") Long packageId, @Param("num") int num);
}

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

@ -78,5 +78,13 @@
ldsa.order_code = #{orderCode} AND ldsa.warehouse_id = #{warehouseId} AND ldsa.is_deleted = 0
</select>
<update id="addZeroQuantity">
UPDATE
logpm_distribution_parcel_number
SET
hand_quantity = hand_quantity + #{num}
WHERE
parcel_list_id = #{packageId}
</update>
</mapper>

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java

@ -258,4 +258,7 @@ public interface IDistributionParcelListService extends BaseService<Distribution
List<JSONObject> findPackageGoodsListByWaybillNo(String waybillNo);
List<DistributionParcelListVO> findEntityVOListByOrderCode(String orderCode, Long fromWarehouseId);
void addZeroPackageQuantity(Long packageId, int num);
}

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

@ -78,4 +78,6 @@ public interface IDistributionParcelNumberService extends BaseService<Distributi
* @param quantity
*/
Integer augmentSignForNum(Long id, Long stockArticleId, Integer quantity);
void addZeroQuantity(Long packageId, int num);
}

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java

@ -1354,6 +1354,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
return baseMapper.findPackageGoodsListByWaybillNo(waybillNo);
}
@Override
public List<DistributionParcelListVO> findEntityVOListByOrderCode(String orderCode, Long fromWarehouseId) {
return baseMapper.findEntityVOListByOrderCode(orderCode,fromWarehouseId);
}
@Override
public void addZeroPackageQuantity(Long packageId, int num) {
baseMapper.addZeroPackageQuantity(packageId,num);
}
private JSONObject handleLogJSONObject(BasicdataWarehouseEntity warehouse, BladeUser user, String orderPackageCode, String content, Integer node) {
JSONObject trunklinePackageTrackLog = new JSONObject();

21
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java

@ -16,31 +16,29 @@
*/
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.DistributionParcelNumberDTO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionParcelNumberEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.excel.DistributionParcelNumberExcel;
import com.logpm.distribution.mapper.DistributionParcelNumberMapper;
import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionParcelNumberService;
import lombok.AllArgsConstructor;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* 订单零担包件数量记录 服务实现类
@ -175,4 +173,9 @@ public class DistributionParcelNumberServiceImpl extends BaseServiceImpl<Distrib
return baseMapper.augmentSignForNum(id,stockArticleId,quantity);
}
@Override
public void addZeroQuantity(Long packageId, int num) {
baseMapper.addZeroQuantity(packageId,num);
}
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/CarsLoadApiController.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.api;
import cn.hutool.core.collection.CollUtil;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -585,6 +586,7 @@ public class CarsLoadApiController {
String trayCode = loadCarsDTO.getTrayCode();
String orderCode = loadCarsDTO.getOrderCode();
Long carsLoadScanId = loadCarsDTO.getCarsLoadScanId();
List<ZeroPackageDTO> zeroPackageList = loadCarsDTO.getZeroPackageList();
try{
@ -607,8 +609,12 @@ public class CarsLoadApiController {
log.warn(method+"订单号为空 orderCode={}",orderCode);
return R.fail(405,"订单号为空");
}
if(CollUtil.isEmpty(zeroPackageList)){
log.warn(method+"品类信息为空 zeroPackageList={}",zeroPackageList);
return R.fail(405,"品类信息为空");
}
return carsLoadService.unloadZero(carsLoadScanId,loadId,waybillNo,enterNum,myCurrentWarehouse.getId(),1,trayCode,orderCode,"零担正常卸车",null,null);
return carsLoadService.unloadZero(carsLoadScanId,loadId,waybillNo,enterNum,myCurrentWarehouse.getId(),1,trayCode,orderCode,"零担正常卸车",null,null,zeroPackageList);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java

@ -77,4 +77,6 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
List<AdvanceDetailVO> findAdvanceDetailListByAdvanceIds(@Param("param") AdvanceDTO advanceDTO);
List<AdvanceDetailVO> findAdvanceDetailListByWaybillId(@Param("param") AdvanceDTO advanceDTO);
List<OrderCodeNumVO> findTotalNumByOrderCodes(@Param("orderCodeSet") Set<String> orderCodeSet);
}

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -480,4 +480,17 @@
</if>
</select>
<select id="findTotalNumByOrderCodes" resultType="com.logpm.trunkline.vo.OrderCodeNumVO">
select order_code orderCode,
IFNULL(count(*),0) totalNum
from logpm_trunkline_advance_detail
where order_code in
<foreach collection="orderCodeSet" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and is_deleted = 0
group by order_code
</select>
</mapper>

7
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.java

@ -2,11 +2,16 @@ package com.logpm.trunkline.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import org.apache.ibatis.annotations.Param;
import org.mapstruct.Mapper;
import java.util.List;
@Mapper
public interface TrunklineScanZeroDetailMapper extends BaseMapper<TrunklineScanZeroDetailEntity> {
List<TrunklineScanZeroDetailVO> findListByCarsLoadScanId(@Param("carsLoadScanId") Long carsLoadScanId);
List<TrunklineScanZeroDetailVO> findListByCarsLoadScanIds(@Param("carsLoadScanIds") List<Long> carsLoadScanIds);
}

21
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineScanZeroDetailMapper.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.trunkline.mapper.TrunklineScanZeroDetailMapper">
<select id="findListByCarsLoadScanId" resultType="com.logpm.trunkline.vo.TrunklineScanZeroDetailVO">
select *
from logpm_trunkline_scan_zero_detail
where scan_id = #{carsLoadScanId}
</select>
<select id="findListByCarsLoadScanIds" resultType="com.logpm.trunkline.vo.TrunklineScanZeroDetailVO">
select *
from logpm_trunkline_scan_zero_detail
where scan_id in
<foreach collection="carsLoadScanIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</select>
</mapper>

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -87,4 +87,7 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
List<AdvanceDetailVO> findAdvanceDetailListByAdvanceIds(AdvanceDTO advanceDTO);
List<AdvanceDetailVO> findAdvanceDetailListByWaybillId(AdvanceDTO advanceDTO);
List<OrderCodeNumVO> findTotalNumByOrderCodes(Set<String> orderCodeSet);
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java

@ -46,6 +46,7 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
List<UnloadScanOrderVO> findPackageWithOrderList(Long loadId, Long warehouseId);
List<UnloadPackageVO> findUnloadPackageList(Long loadId, Long warehouseId, String waybillNo, String orderCode);
List<UnloadPackageVO> findUnloadZeroList(Long loadId, Long warehouseId, String waybillNo, String orderCode);
Integer findUnloadNumByLoadId(Long loadId);

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadService.java

@ -95,7 +95,7 @@ public interface ITrunklineCarsLoadService extends BaseService<TrunklineCarsLoad
R unloadPackage(Long loadId, String orderPackageCode, Long warehouseId,Integer unbindTray,String remark,Integer incomingType,String unloadTrayName,String unloadTrayCode);
R unloadZero(Long carsLoadScanId,Long loadId, String waybillNo,Integer enterNum, Long warehouseId,Integer unbindTray,String trayCode,String orderCode,String remark,String unloadTrayName,String unloadTrayCode);
R unloadZero(Long carsLoadScanId,Long loadId, String waybillNo,Integer enterNum, Long warehouseId,Integer unbindTray,String trayCode,String orderCode,String remark,String unloadTrayName,String unloadTrayCode,List<ZeroPackageDTO> zeroPackageList);
R findLoadScanWaybillDetailList(Long loadId, String orderCode, Long warehouseId);

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineScanZeroDetailService.java

@ -1,7 +1,13 @@
package com.logpm.trunkline.service;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
public interface ITrunklineScanZeroDetailService extends BaseService<TrunklineScanZeroDetailEntity> {
List<TrunklineScanZeroDetailVO> findListByCarsLoadScanId(Long carsLoadScanId);
List<TrunklineScanZeroDetailVO> findListByCarsLoadScanIds(List<Long> carsLoadScanIds);
}

54
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java

@ -4,14 +4,18 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordZeroDetailEntity;
import com.logpm.aftersales.feign.IAftersalesAbnormalRecordClient;
import com.logpm.aftersales.feign.IAftersalesAbnormalRecordZeroDetailClient;
import com.logpm.aftersales.feign.IAftersalesWorkOrderClient;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import com.logpm.trunkline.vo.UnloadReportVO;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
@ -23,6 +27,7 @@ import org.springblade.common.constant.TenantNum;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.system.cache.DictBizCache;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
@ -33,6 +38,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Service
@ -61,6 +67,14 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
private ITrunklineCarsUnloadLogService trunklineCarsUnloadLogService;
@Autowired
private RabbitTemplate rabbitTemplate;
@Autowired
private IDistributionParcelListClient distributionParcelListClient;
@Autowired
private ITrunklineScanZeroDetailService trunklineScanZeroDetailService;
@Autowired
private IOpenOrderAsyncService openOrderAsyncService;
@Autowired
private IAftersalesAbnormalRecordZeroDetailClient abnormalRecordZeroDetailClient;
@LogpmAsync("asyncExecutor")
@Override
@ -521,6 +535,9 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
Integer num = carsLoadScanEntity.getNum();
String scanStatus = carsLoadScanEntity.getScanStatus();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
WarehouseWaybillEntity warehouseWaybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
Long waybillId = warehouseWaybill.getId();
List<TrunklineScanZeroDetailVO> zeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanId(scanId);
//卸车数量异常
AftersalesAbnormalRecordEntity abnormalRecordEntity = new AftersalesAbnormalRecordEntity();
@ -547,7 +564,15 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(!Objects.isNull(stockArticleEntity)){
distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(),num-unloadNum);
zeroDetailVOList.forEach(zeroDetailVO -> {
Long packageId = zeroDetailVO.getPackageId();
Integer loadingNum = zeroDetailVO.getLoadingNum();
Integer unloadNum1 = zeroDetailVO.getUnloadNum();
distributionParcelListClient.addZeroQuantity(packageId,loadingNum-unloadNum1);
});
}
String content = warehouseName+"干线未签收卸车回库,总数/卸车数:"+num+"/"+num+",卸车时间"+ CommonUtil.dateToStringGeneral(new Date());;
openOrderAsyncService.saveLog(waybillId,waybillNo,"80","零担未签收回库",content,AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName);
}
abnormalRecordEntity.setSendOrderStatus(0);
abnormalRecordEntity.setUpTime(new Date());
@ -558,7 +583,34 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
addList.add(abnormalRecordEntity);
});
}
abnormalRecordClient.addAbnormalRecordList(addList);
List<AftersalesAbnormalRecordEntity> aftersalesAbnormalRecordEntities = abnormalRecordClient.addAbnormalRecordListReturnList(addList);
//把aftersalesAbnormalRecordEntities只保留isZero等于1的数据
List<AftersalesAbnormalRecordEntity> abnormalRecordEntities1 = aftersalesAbnormalRecordEntities.stream().filter(abnormalRecordEntity -> abnormalRecordEntity.getIsZero() == 1).collect(Collectors.toList());
//把abnormalRecordEntities1中所有元素associationId放入一个集合
List<Long> associationIdList = abnormalRecordEntities1.stream().map(AftersalesAbnormalRecordEntity::getAssociationId).collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> scanZeroDetailVOList = trunklineScanZeroDetailService.findListByCarsLoadScanIds(associationIdList);
//把scanZeroDetailVOList所有元素通过scanId进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> scanZeroDetailVOMap = scanZeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
List<AftersalesAbnormalRecordZeroDetailEntity> abnormalRecordZeroDetailEntityList = new ArrayList<>();
abnormalRecordEntities1.forEach(abnormalRecordEntity -> {
Long associationId = abnormalRecordEntity.getAssociationId();
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailVOMap.get(associationId);
Long abnormalRecordId = abnormalRecordEntity.getId();
zeroDetailVOList.forEach(zeroDetailVO -> {
AftersalesAbnormalRecordZeroDetailEntity abnormalRecordZeroDetailEntity = new AftersalesAbnormalRecordZeroDetailEntity();
abnormalRecordZeroDetailEntity.setAbnormalRecordId(abnormalRecordId);
abnormalRecordZeroDetailEntity.setPackageId(zeroDetailVO.getPackageId());
abnormalRecordZeroDetailEntity.setGoodsId(zeroDetailVO.getGoodsId());
abnormalRecordZeroDetailEntity.setGoodsName(zeroDetailVO.getGoodsName());
abnormalRecordZeroDetailEntity.setAbnormalNum(zeroDetailVO.getLoadingNum()-zeroDetailVO.getUnloadNum());
abnormalRecordZeroDetailEntity.setReturnNum(0);
abnormalRecordZeroDetailEntity.setIncomingNum(0);
abnormalRecordZeroDetailEntityList.add(abnormalRecordZeroDetailEntity);
});
});
if(CollUtil.isNotEmpty(abnormalRecordZeroDetailEntityList)){
abnormalRecordZeroDetailClient.addAbnormalRecordZeroDetail(abnormalRecordZeroDetailEntityList);
}
}
@LogpmAsync("asyncExecutor")

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -357,4 +357,9 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
public List<AdvanceDetailVO> findAdvanceDetailListByWaybillId(AdvanceDTO advanceDTO) {
return baseMapper.findAdvanceDetailListByWaybillId(advanceDTO);
}
@Override
public List<OrderCodeNumVO> findTotalNumByOrderCodes(Set<String> orderCodeSet) {
return baseMapper.findTotalNumByOrderCodes(orderCodeSet);
}
}

27
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java

@ -9,6 +9,7 @@ import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.mapper.TrunklineCarsLoadScanMapper;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineScanZeroDetailService;
import com.logpm.trunkline.vo.*;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import lombok.AllArgsConstructor;
@ -16,16 +17,19 @@ import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Slf4j
@Service
@AllArgsConstructor
public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineCarsLoadScanMapper, TrunklineCarsLoadScanEntity> implements ITrunklineCarsLoadScanService {
private final ITrunklineScanZeroDetailService scanZeroDetailService;
@Override
public Integer findNumByLoadId(Long loadId) {
return baseMapper.findNumByLoadId(loadId);
@ -101,6 +105,27 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
return baseMapper.findUnloadPackageList(loadId,warehouseId,waybillNo,orderCode);
}
@Override
public List<UnloadPackageVO> findUnloadZeroList(Long loadId, Long warehouseId, String waybillNo, String orderCode) {
List<UnloadPackageVO> unloadPackageList = baseMapper.findUnloadPackageList(loadId, warehouseId, waybillNo, orderCode);
//把unloadPackageList中所有元素的carsLoadScanId放入一个集合
// 创建一个包含所有carsLoadScanId的新列表
List<Long> carsLoadScanIds = unloadPackageList.stream()
.map(UnloadPackageVO::getCarsLoadScanId)
.collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> scanZeroDetailList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
//把scanZeroDetailList中所有元素通过id进行分组
Map<Long, List<TrunklineScanZeroDetailVO>> scanZeroDetailMap = scanZeroDetailList.stream()
.collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
unloadPackageList.forEach(unloadPackageVO -> {
Long carsLoadScanId = unloadPackageVO.getCarsLoadScanId();
List<TrunklineScanZeroDetailVO> list = scanZeroDetailMap.get(carsLoadScanId);
unloadPackageVO.setScanZeroDetailList(list);
});
return unloadPackageList;
}
@Override
public Integer findUnloadNumByLoadId(Long loadId) {
return baseMapper.findUnloadNumByLoadId(loadId);

446
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -28,6 +28,7 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionParcelNumberClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.factorydata.enums.BrandEnums;
import com.logpm.factorydata.feign.IFactoryDataClient;
import com.logpm.factorydata.util.FactoryDataMessageSender;
@ -1200,162 +1201,155 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//把orderCodeList通过fromWarehouseId进行分组
Map<Long, List<TrunklineCarsLoadScanEntity>> fromWarehouseIdmap = orderCodeList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getFromWarehouseId));
fromWarehouseIdmap.keySet().forEach(fromWarehouseId -> {
TrunklineCarsOrderEntity trunklineCarsOrderEntity = trunklineCarsOrderService.findEntityByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(loadId, fromWarehouseId, orderCode, orderCode);
if(!Objects.isNull(trunklineCarsOrderEntity)){
Integer realNum = trunklineCarsOrderEntity.getRealNum();
List<TrunklineCarsLoadScanEntity> fromWarehouseIdList = fromWarehouseIdmap.get(fromWarehouseId);
//把fromWarehouseIdList中所有元素的unloadNum累加
int unloadNum = fromWarehouseIdList.stream().mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(!Objects.isNull(stockArticleEntity)){
Integer handQuantity = stockArticleEntity.getHandQuantity();
if(unloadNum > realNum){
//卸车数大于实际装车数
throw new CustomerException(405,"零担订单"+orderCode+"卸车件数已大于实际装车件数,请去调整补录");
}else {
// if(unloadNum < realNum){
// distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(),realNum-unloadNum);
// }
DistributionStockArticleEntity newStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(newStockArticleEntity)) {
newStockArticleEntity = new DistributionStockArticleEntity();
BeanUtil.copy(stockArticleEntity, newStockArticleEntity);
newStockArticleEntity.setId(null);
List<TrunklineCarsLoadScanEntity> fromWarehouseIdList = fromWarehouseIdmap.get(fromWarehouseId);
int realNum = fromWarehouseIdList.stream().mapToInt(TrunklineCarsLoadScanEntity::getNum).sum();
//把fromWarehouseIdList中所有元素的unloadNum累加
int unloadNum = fromWarehouseIdList.stream().mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(!Objects.isNull(stockArticleEntity)){
if(unloadNum > realNum){
//卸车数大于实际装车数
throw new CustomerException(405,"零担订单"+orderCode+"卸车件数已大于实际装车件数,请去调整补录");
}else {
//把fromWarehouseIdList中所有元素的id放入一个集合
List<Long> carsLoadScanIds = fromWarehouseIdList.stream().map(TrunklineCarsLoadScanEntity::getId).collect(Collectors.toList());
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIds);
//把zeroDetailVOList所有元素通过goodsName进行分组
Map<String, List<TrunklineScanZeroDetailVO>> goodsNamemap = zeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getGoodsName));
DistributionStockArticleEntity newStockArticleEntity = distributionStockArticleClient.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (Objects.isNull(newStockArticleEntity)) {
newStockArticleEntity = new DistributionStockArticleEntity();
BeanUtil.copy(stockArticleEntity, newStockArticleEntity);
Integer totalNumber = stockArticleEntity.getTotalNumber();
newStockArticleEntity.setId(null);
if(totalNumber == unloadNum){
newStockArticleEntity.setOrderReceiveStatus("30");
}else{
newStockArticleEntity.setOrderReceiveStatus("20");
newStockArticleEntity.setOrderStatus("10");
newStockArticleEntity.setHandQuantity(unloadNum);
newStockArticleEntity.setIncomingNum(unloadNum);
newStockArticleEntity.setWarehouse(warehouseEntity.getName());
newStockArticleEntity.setWarehouseId(warehouseEntity.getId());
newStockArticleEntity.setAllocation(null);
newStockArticleEntity.setTrays(null);
newStockArticleEntity.setCarsLoadNum(0);
Long orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if (orderId != 0) {
Integer isTransfer = 1;
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, fromWarehouseId);
List<DistributionParcelNumberEntity> ls = new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : parcelListEntityList) {
DistributionParcelListEntity newParcelListEntity = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity, newParcelListEntity);
newParcelListEntity.setId(null);
newParcelListEntity.setWarehouseId(warehouseId);
newParcelListEntity.setWarehouse(warehouseEntity.getName());
newParcelListEntity.setStockArticleId(orderId);
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
if(warehouseId.equals(acceptWarehouseId)){
newParcelListEntity.setIsTransfer(0);
isTransfer = 0;
// String operationRemark = "运单装车"+unloadNum+"件 干线批次号:"+carsLoadEntity.getCarsNo()+",车牌号:"+carsLoadEntity.getCarNumber()+",司机姓名:"+carsLoadEntity.getDriverName()+",司机手机:"+carsLoadEntity.getDriverMobile();
// openOrderAsyncService.saveLog(waybillId, waybillNo, "30", "干线装车", operationRemark, AuthUtil.getNickName(), AuthUtil.getUserId(), warehouseId, warehouseName);
}else{
newParcelListEntity.setIsTransfer(1);
}
Long orderPackageId = distributionParcelListClient.addReturnId(newParcelListEntity);
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setStockArticleId(orderId);
parcelNumberEntity.setParcelListId(orderPackageId);
parcelNumberEntity.setQuantity(newParcelListEntity.getQuantity());
parcelNumberEntity.setHandQuantity(newParcelListEntity.getQuantity());
parcelNumberEntity.setDeliveryQuantity(0);
parcelNumberEntity.setSigninQuantity(0);
parcelNumberEntity.setOutboundQuantity(0);
parcelNumberEntity.setWarehouseId(warehouseId);
ls.add(parcelNumberEntity);
}
newStockArticleEntity.setOrderStatus("10");
newStockArticleEntity.setHandQuantity(unloadNum);
newStockArticleEntity.setIncomingNum(unloadNum);
newStockArticleEntity.setWarehouse(warehouseEntity.getName());
newStockArticleEntity.setWarehouseId(warehouseEntity.getId());
newStockArticleEntity.setAllocation(null);
newStockArticleEntity.setTrays(null);
newStockArticleEntity.setCarsLoadNum(0);
Long orderId = distributionStockArticleClient.addData(newStockArticleEntity);
if (orderId != 0) {
Integer isTransfer = 1;
List<DistributionParcelListVO> parcelListEntityList = distributionParcelListClient.findEntityVOListByOrderCode(orderCode, fromWarehouseId);
List<DistributionParcelNumberEntity> ls = new ArrayList<>();
for (DistributionParcelListVO parcelListEntity : parcelListEntityList) {
DistributionParcelListEntity newParcelListEntity = new DistributionParcelListEntity();
String firsts = parcelListEntity.getFirsts();
List<TrunklineScanZeroDetailVO> detailVOList = goodsNamemap.get(firsts);
//把detailVOList所有元素的unloadNum求和,如果为空用0代替
int totalUnloadNum = detailVOList.stream()
.mapToInt(vo -> Optional.ofNullable(vo.getUnloadNum()).orElse(0))
.sum();
BeanUtil.copy(parcelListEntity, newParcelListEntity);
newParcelListEntity.setId(null);
newParcelListEntity.setWarehouseId(warehouseId);
newParcelListEntity.setWarehouse(warehouseEntity.getName());
newParcelListEntity.setStockArticleId(orderId);
newParcelListEntity.setQuantity(totalUnloadNum);
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
if(warehouseId.equals(acceptWarehouseId)){
newParcelListEntity.setIsTransfer(0);
isTransfer = 0;
}else{
newParcelListEntity.setIsTransfer(1);
}
distributionParcelNumberClient.addBatch(ls);
// if(isTransfer == 0){
// //查询零担发车件数
// List<ZeroNumVO> zeroNumVOList = trunklineCarsLoadScanService.findZeroStartNum(loadId,warehouseId);
// if(CollUtil.isNotEmpty(zeroNumVOList)){
// zeroNumVOList.forEach(zeroNumVO -> {
// String waybillNo = zeroNumVO.getWaybillNo();
// Integer num = zeroNumVO.getNum();
// WarehouseWaybillEntity waybill = warehouseWaybillClient.findByWaybillNo(waybillNo);
// Integer totalCount = waybill.getTotalCount();
// Integer waybillStatusInt = Integer.parseInt(waybill.getWaybillStatus());
// TrunklineWaybillOrderEntity waybillOrderEntity = trunklineWaybillOrderService.findEntityByWaybillNoAndOrderCode(waybillNo,waybillNo);
// if(!Objects.isNull(waybillOrderEntity)){
// Integer handleNumber = waybillOrderEntity.getHandleNumber();
// if(waybillStatusInt <= 40){
// if(Objects.isNull(handleNumber)){
// handleNumber = 0;
// }
// int i = handleNumber - num;
// if(i==0){
// waybill.setWaybillStatus("20");
// waybillOrderEntity.setHandleNumber(totalCount);
// }else{
// waybill.setWaybillStatus("30");
// waybillOrderEntity.setHandleNumber(i);
// }
//
// warehouseWaybillClient.updateEntity(waybill);
// trunklineWaybillOrderService.updateById(waybillOrderEntity);
// }
//
// }
//
// });
// }
// }
Long orderPackageId = distributionParcelListClient.addReturnId(newParcelListEntity);
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setStockArticleId(orderId);
parcelNumberEntity.setParcelListId(orderPackageId);
parcelNumberEntity.setQuantity(parcelListEntity.getZeroPackageTotalNum());
parcelNumberEntity.setHandQuantity(totalUnloadNum);
parcelNumberEntity.setDeliveryQuantity(0);
parcelNumberEntity.setSigninQuantity(0);
parcelNumberEntity.setOutboundQuantity(0);
parcelNumberEntity.setWarehouseId(warehouseId);
ls.add(parcelNumberEntity);
}
} else {
Integer hQuantity = newStockArticleEntity.getHandQuantity() + unloadNum;
Integer incomingNum = newStockArticleEntity.getIncomingNum() + unloadNum;
Integer totalNumber = newStockArticleEntity.getTotalNumber();
if (incomingNum.equals(totalNumber)) {
if (hQuantity.equals(totalNumber)) {
newStockArticleEntity.setOrderStatus("20");
} else {
newStockArticleEntity.setOrderStatus("30");
}
newStockArticleEntity.setOrderReceiveStatus("30");
distributionParcelNumberClient.addBatch(ls);
}
} else {
Integer hQuantity = newStockArticleEntity.getHandQuantity() + unloadNum;
Integer incomingNum = newStockArticleEntity.getIncomingNum() + unloadNum;
Integer totalNumber = newStockArticleEntity.getTotalNumber();
if (incomingNum.equals(totalNumber)) {
if (hQuantity.equals(totalNumber)) {
newStockArticleEntity.setOrderStatus("20");
} else {
if (incomingNum.equals(hQuantity)) {
newStockArticleEntity.setOrderStatus("10");
} else {
newStockArticleEntity.setOrderStatus("30");
}
newStockArticleEntity.setOrderReceiveStatus("20");
newStockArticleEntity.setOrderStatus("30");
}
newStockArticleEntity.setHandQuantity(hQuantity);
newStockArticleEntity.setIncomingNum(incomingNum);
distributionStockArticleClient.saveOrUpdate(newStockArticleEntity);
// String waybillNumber = newStockArticleEntity.getWaybillNumber();
// WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNumber);
// Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();
// if(warehouseId.equals(destinationWarehouseId)){
// QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("waybill_no",stockArticleEntity.getWaybillNumber())
// .eq("order_code",stockArticleEntity.getWaybillNumber());
// TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
// if(!Objects.isNull(one)){
// Integer totalCount = warehouseWaybillEntity.getTotalCount();
// Integer waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
// if(waybillStatusInt <= 30){
// Integer handleNumber = one.getHandleNumber();
// int total = handleNumber + unloadNum;
// if(total < totalCount){
// warehouseWaybillEntity.setWaybillStatus("50");
// one.setHandleNumber(total);
// }else{
// warehouseWaybillEntity.setWaybillStatus("60");
// one.setHandleNumber(totalCount);
// }
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// trunklineWaybillOrderService.updateById(one);
// }
// }
// }
newStockArticleEntity.setOrderReceiveStatus("30");
} else {
newStockArticleEntity.setOrderReceiveStatus("20");
}
newStockArticleEntity.setHandQuantity(hQuantity);
newStockArticleEntity.setIncomingNum(incomingNum);
List<DistributionParcelListEntity> listEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, warehouseId);
//把listEntityList中所有元素的id放入一个集合
List<Long> parcelListIds = listEntityList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList());
List<DistributionParcelNumberEntity> parceNumberList = distributionParcelNumberClient.findListByParcelListIds(parcelListIds);
//把parceNumberList转化成以parcelListId为key的Map
Map<Long, DistributionParcelNumberEntity> mapByParcelListId = parceNumberList.stream()
.collect(Collectors.toMap(
DistributionParcelNumberEntity::getParcelListId,
entity -> entity,
(entity1, entity2) -> entity1)); // 处理可能的键冲突
List<DistributionParcelListEntity> updateParceList = new ArrayList<>();
List<DistributionParcelNumberEntity> updateParceNumberList = new ArrayList<>();
listEntityList.forEach(entity -> {
Long parceListId = entity.getId();
String firsts = entity.getFirsts();
List<TrunklineScanZeroDetailVO> detailVOList = goodsNamemap.get(firsts);
//把detailVOList所有元素的unloadNum求和,如果为空用0代替
int totalUnloadNum = detailVOList.stream()
.mapToInt(vo -> Optional.ofNullable(vo.getUnloadNum()).orElse(0))
.sum();
Integer quantity = entity.getQuantity();
DistributionParcelListEntity updatePaceList = new DistributionParcelListEntity();
updatePaceList.setId(parceListId);
updatePaceList.setQuantity(quantity+totalUnloadNum);
updateParceList.add(updatePaceList);
DistributionParcelNumberEntity parcelNumberEntity = mapByParcelListId.get(parceListId);
if(!Objects.isNull(parcelNumberEntity)){
Integer handQuantity = parcelNumberEntity.getHandQuantity();
DistributionParcelNumberEntity updateParceNumberEntity = new DistributionParcelNumberEntity();
updateParceNumberEntity.setId(parcelNumberEntity.getId());
updateParceNumberEntity.setHandQuantity(handQuantity + totalUnloadNum);
updateParceNumberList.add(updateParceNumberEntity);
}
});
if(CollUtil.isNotEmpty(updateParceList)){
distributionParcelListClient.updateList(updateParceList);
}
if(CollUtil.isNotEmpty(updateParceNumberList)){
distributionParcelNumberClient.updateList(updateParceNumberList);
}
distributionStockArticleClient.saveOrUpdate(newStockArticleEntity);
}
}
}
@ -1364,48 +1358,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
WarehouseWaybillEntity warehouseWaybillEntity = warehouseWaybillClient.findByWaybillNo(orderCode);
waybillPackageService.updateWaybillStatus(warehouseWaybillEntity);
// String waybillNo = warehouseWaybillEntity.getWaybillNo();
// Long waybillId = warehouseWaybillEntity.getId();
// int unloadNum = orderCodeList.stream().mapToInt(TrunklineCarsLoadScanEntity::getUnloadNum).sum();
// Long destinationWarehouseId = warehouseWaybillEntity.getDestinationWarehouseId();
// if(warehouseId.equals(destinationWarehouseId)){
// QueryWrapper<TrunklineWaybillOrderEntity> queryWrapper1 = new QueryWrapper<>();
// queryWrapper1.eq("waybill_no",orderCode)
// .eq("order_code",orderCode);
// TrunklineWaybillOrderEntity one = trunklineWaybillOrderService.getOne(queryWrapper1);
// if(!Objects.isNull(one)){
// Integer handleNumber = one.getHandleNumber();
// Integer totalCount = warehouseWaybillEntity.getTotalCount();
// Integer waybillStatusInt = Integer.parseInt(warehouseWaybillEntity.getWaybillStatus());
// int total = handleNumber + unloadNum;
// if(waybillStatusInt < 50){
// if(total != totalCount){
// warehouseWaybillEntity.setWaybillStatus("50");
// one.setHandleNumber(total);
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// trunklineWaybillOrderService.updateById(one);
// }else{
// warehouseWaybillEntity.setWaybillStatus("60");
// one.setHandleNumber(total);
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// trunklineWaybillOrderService.updateById(one);
// }
// }else if(waybillStatusInt == 50){
// if(total == totalCount){
// warehouseWaybillEntity.setWaybillStatus("60");
// one.setHandleNumber(total);
// warehouseWaybillClient.updateEntity(warehouseWaybillEntity);
// trunklineWaybillOrderService.updateById(one);
// }
// }
// }
// }
});
}
//无装车记录异常日志记录
try {
// carsLoadAsyncService.
carsLoadAsyncService.abnormalListUnloadCheckByLoadIdAndWarehouseId(loadId, warehouseId, currentCarsLoadLineEntity.getNodeName(), AuthUtil.getTenantId(), AuthUtil.getUserId(), AuthUtil.getNickName(), Func.firstLong(AuthUtil.getDeptId()),currentCarsLoadLineEntity);
List<String> orderPackageCodes = trunklineCarsLoadScanService.findUnloadByLoadIdAndWarehouseId(loadId, warehouseId);
@ -3218,8 +3176,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
});
}
}
scanZeroDetailService.saveBatch(zeroDetailList);
distributionParcelListClient.updateList(updateParceList);
if(CollUtil.isNotEmpty(zeroDetailList)){
scanZeroDetailService.saveBatch(zeroDetailList);
}
if(CollUtil.isNotEmpty(updateParceList)){
distributionParcelListClient.updateList(updateParceList);
}
difficult = enterNum;
distributionStockArticleClient.submitHandleNumByOrderId(enterNum, articleId);
@ -3280,8 +3242,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
zeroDetailList.add(scanZeroDetailEntity);
}
distributionParcelListClient.updateList(updateParceList);
scanZeroDetailService.updateBatchById(zeroDetailList);
if(CollUtil.isNotEmpty(zeroDetailList)){
scanZeroDetailService.updateBatchById(zeroDetailList);
}
if(CollUtil.isNotEmpty(updateParceList)){
distributionParcelListClient.updateList(updateParceList);
}
}
audio = (enterNum)+"件";
@ -4031,6 +3997,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long warehouseId = loadCarsDTO.getWarehouseId();
Integer incomingType = loadCarsDTO.getIncomingType();
Long carsLoadScanId = loadCarsDTO.getCarsLoadScanId();
List<ZeroPackageDTO> zeroPackageList = loadCarsDTO.getZeroPackageList();
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(basicdataTrayEntity)){
@ -4050,7 +4017,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
R r = trayTypeClient.orderScanOrderPackageCodeReturnR(map);
int code = r.getCode();
if (code != 200) {
log.warn("##########findNextNodeList: 打托失败 trayCode={} orderPackageCode={} msg={}", trayCode, orderPackageCode, r.getMsg());
log.warn("##########unloadTrayAllOne: 打托失败 trayCode={} orderPackageCode={} msg={}", trayCode, orderPackageCode, r.getMsg());
return R.fail(code, r.getMsg());
}else{
String data = (String) r.getData();
@ -4064,7 +4031,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
} else {
unloadZero(carsLoadScanId,loadId, waybillNo, enterNum, warehouseId, 1, null, orderCode, "卸分一体 卸车",palletName,trayCode);
if(CollUtil.isEmpty(zeroPackageList)){
log.warn("##########unloadTrayAllOne: 品类信息有误 carsLoadScanId={} ", carsLoadScanId);
return R.fail(405, "品类信息有误");
}
unloadZero(carsLoadScanId,loadId, waybillNo, enterNum, warehouseId, 1, null, orderCode, "卸分一体 卸车",palletName,trayCode,zeroPackageList);
Map<String, Object> map = new HashMap<>();
map.put("trayType", trayType);
@ -4559,14 +4531,32 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
List<UnloadPackageDTO> unloadPackageList = batchUnloadDTO.getUnloadPackageList();
List<UnloadZeroDTO> unloadZeroList = batchUnloadDTO.getUnloadZeroList();
for (UnloadZeroDTO unloadZeroDTO : unloadZeroList) {
Long carsLoadScanId = unloadZeroDTO.getCarsLoadScanId();
String waybillNo = unloadZeroDTO.getWaybillNo();
Integer enterNum = unloadZeroDTO.getEnterNum();
String trayCode = unloadZeroDTO.getTrayCode();
String orderCode = unloadZeroDTO.getOrderCode();
unloadZero(carsLoadScanId,loadId, waybillNo, enterNum, warehouseId, 1, trayCode, orderCode, "批量卸车零担正常卸车",null,null);
//把unloadZeroList中所有元素的carsLoadScanId放入一个list中
List<Long> carsLoadScanIdList = unloadZeroList.stream().map(UnloadZeroDTO::getCarsLoadScanId).collect(Collectors.toList());
if(CollUtil.isNotEmpty(carsLoadScanIdList)){
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIdList);
//把zeroDetailVOList所有元素通过id分组
Map<Long, List<TrunklineScanZeroDetailVO>> zeroDetailVOMap = zeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getId));
for (UnloadZeroDTO unloadZeroDTO : unloadZeroList) {
Long carsLoadScanId = unloadZeroDTO.getCarsLoadScanId();
String waybillNo = unloadZeroDTO.getWaybillNo();
Integer enterNum = unloadZeroDTO.getEnterNum();
String trayCode = unloadZeroDTO.getTrayCode();
String orderCode = unloadZeroDTO.getOrderCode();
List<TrunklineScanZeroDetailVO> list = zeroDetailVOMap.get(carsLoadScanId);
List<ZeroPackageDTO> zeroPackageList = new ArrayList<>();
list.forEach(zeroDetailVO -> {
ZeroPackageDTO zeroPackageDTO = new ZeroPackageDTO();
zeroPackageDTO.setPackageId(zeroDetailVO.getPackageId());
zeroPackageDTO.setGoodsId(zeroDetailVO.getGoodsId());
zeroPackageDTO.setGoodsName(zeroDetailVO.getGoodsName());
zeroPackageDTO.setEnterNum(zeroDetailVO.getLoadingNum());
zeroPackageList.add(zeroPackageDTO);
});
unloadZero(carsLoadScanId,loadId, waybillNo, enterNum, warehouseId, 1, trayCode, orderCode, "批量卸车零担正常卸车",null,null,zeroPackageList);
}
}
List<Long> carsLoadScanIds = new ArrayList<>();
@ -4596,7 +4586,6 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
findParamterDTO.setWarehouseId(fromWarehouseId);
List<DistributionStockArticleEntity> stockArticleEntityList = distributionStockArticleClient.findListByOrderCodesAndWarehouseId(findParamterDTO);
stockArticleEntities.addAll(stockArticleEntityList);
});
//把stockArticleEntities转成orderCode为键值的map
@ -8953,9 +8942,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
@Override
public R unloadZero(Long carsLoadScanId,Long loadId, String waybillNo, Integer enterNun, Long warehouseId, Integer unbindTray, String trayCode, String orderCode, String remark,String unloadTrayName,String unloadTrayCode) {
public R unloadZero(Long carsLoadScanId,Long loadId, String waybillNo, Integer enterNun, Long warehouseId, Integer unbindTray, String trayCode, String orderCode, String remark,String unloadTrayName,String unloadTrayCode,List<ZeroPackageDTO> zeroPackageList) {
log.info("#############unloadZero: 卸车零担");
if(CollUtil.isEmpty(zeroPackageList)){
log.warn("#############unloadZero: ;品类信息有误 zeroPackageList={}", zeroPackageList);
return R.fail(405, "品类信息有误");
}
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId);
if (Objects.isNull(carsLoadEntity)) {
log.warn("#############unloadZero: 配载计划信息不存在 loadId={}", loadId);
@ -9029,6 +9023,27 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setUnloadTrayCode(unloadTrayCode);
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
//把zeroPackageList中所有元素转化成以goodsId为key的map
Map<Long, ZeroPackageDTO> zeroDetailMap = zeroPackageList.stream().collect(Collectors.toMap(ZeroPackageDTO::getGoodsId, Function.identity()));
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanId(carsLoadScanId);
List<TrunklineScanZeroDetailEntity> updateList = new ArrayList<>();
zeroDetailVOList.forEach(detailVO -> {
Long goodsId = detailVO.getGoodsId();
Long id = detailVO.getId();
ZeroPackageDTO zeroPackageDTO = zeroDetailMap.get(goodsId);
if(!Objects.isNull(zeroPackageDTO)){
TrunklineScanZeroDetailEntity updateEntity = new TrunklineScanZeroDetailEntity();
updateEntity.setId(id);
updateEntity.setUnloadNum(zeroPackageDTO.getEnterNum());
updateList.add(updateEntity);
}
});
if(CollUtil.isNotEmpty(updateList)){
scanZeroDetailService.updateBatchById(updateList);
}
trunklineCarsUnloadLogService.savaUnloadLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode,
scanCode, enterNun, 2, 1, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
@ -9435,23 +9450,30 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//查询已扫描卸车的包件
List<UnloadScanOrderVO> unloadScanOrderList = trunklineCarsLoadScanService.findPackageWithOrderList(loadId, warehouseId);
for (UnloadScanOrderVO unloadScanOrderVO : unloadScanOrderList) {
Integer loadingNum = unloadScanOrderVO.getLoadingNum();
String waybillNo = unloadScanOrderVO.getWaybillNo();
String orderCode = unloadScanOrderVO.getOrderCode();
Integer totalNumber = trunklineAdvanceDetailService.findTotalNumByOrderCode(orderCode);
unloadScanOrderVO.setTotalNumber(totalNumber);
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId, warehouseId, waybillNo, orderCode);
unloadScanOrderVO.setUnloadPackageList(unloadPackageList);
if(CollUtil.isNotEmpty(unloadScanOrderList)){
//把unloadScanOrderList中所有元素转化成以orderCode为key的map
Map<String, UnloadScanOrderVO> unloadScanOrderMap = unloadScanOrderList.stream().collect(Collectors.toMap(UnloadScanOrderVO::getOrderCode, Function.identity()));
Set<String> orderCodeSet = unloadScanOrderMap.keySet();
List<OrderCodeNumVO> orderCodeNumList = trunklineAdvanceDetailService.findTotalNumByOrderCodes(orderCodeSet);
//把orderCodeNumList中所有元素转化成以orderCode为key的map
Map<String, OrderCodeNumVO> orderCodeNumMap = orderCodeNumList.stream().collect(Collectors.toMap(OrderCodeNumVO::getOrderCode, Function.identity()));
for (UnloadScanOrderVO unloadScanOrderVO : unloadScanOrderList) {
String waybillNo = unloadScanOrderVO.getWaybillNo();
String orderCode = unloadScanOrderVO.getOrderCode();
unloadScanOrderVO.setTotalNumber(orderCodeNumMap.get(orderCode).getTotalNum());
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId, warehouseId, waybillNo, orderCode);
unloadScanOrderVO.setUnloadPackageList(unloadPackageList);
}
}
//查询已装车的零担
List<UnloadZeroVO> zeroList = trunklineCarsLoadScanService.findUnloadZeroList(loadId, warehouseId);
for (UnloadZeroVO unloadZeroVO : zeroList) {
Integer loadingNum = unloadZeroVO.getLoadingNum();
String waybillNo = unloadZeroVO.getWaybillNo();
String orderCode = unloadZeroVO.getOrderCode();
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadPackageList(loadId, warehouseId, waybillNo, orderCode);
List<UnloadPackageVO> unloadPackageList = trunklineCarsLoadScanService.findUnloadZeroList(loadId, warehouseId, waybillNo, orderCode);
unloadZeroVO.setUnloadPackageList(unloadPackageList);
}

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineScanZeroDetailServiceImpl.java

@ -3,13 +3,25 @@ package com.logpm.trunkline.service.impl;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import com.logpm.trunkline.mapper.TrunklineScanZeroDetailMapper;
import com.logpm.trunkline.service.ITrunklineScanZeroDetailService;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@AllArgsConstructor
@Slf4j
public class TrunklineScanZeroDetailServiceImpl extends BaseServiceImpl<TrunklineScanZeroDetailMapper, TrunklineScanZeroDetailEntity> implements ITrunklineScanZeroDetailService {
@Override
public List<TrunklineScanZeroDetailVO> findListByCarsLoadScanId(Long carsLoadScanId) {
return baseMapper.findListByCarsLoadScanId(carsLoadScanId);
}
@Override
public List<TrunklineScanZeroDetailVO> findListByCarsLoadScanIds(List<Long> carsLoadScanIds) {
return baseMapper.findListByCarsLoadScanIds(carsLoadScanIds);
}
}

Loading…
Cancel
Save