Browse Source

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

visual
zhenghaoyu 3 months ago
parent
commit
33f95e0471
  1. 3
      blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  3. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelNumberClient.java
  4. 4
      blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/vo/PushData.java
  5. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java
  6. 9
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  7. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  8. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelNumberClient.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  10. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  11. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.java
  12. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelNumberMapper.xml
  13. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java
  14. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelNumberService.java
  15. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  16. 29
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelNumberServiceImpl.java
  17. 8
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml
  18. 189
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  19. 141
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  20. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java

3
blade-biz-common/src/main/java/org/springblade/common/constant/OldSystemDataPushConfig.java

@ -106,6 +106,9 @@ public class OldSystemDataPushConfig {
//仁寿欧派大家居
warehourseIds.add("127");
//生活家成都仓
warehourseIds.add("71");
}

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

@ -284,5 +284,8 @@ public interface IDistributionParcelListClient {
*/
@GetMapping(API_PREFIX + "/findOrderInfoByOrderPackageCode")
Map<String,Object> findOrderInfoByOrderPackageCode(@RequestParam("orderPackageCode") String orderPackageCode,@RequestParam("warehouseId") Long warehouseId);
@PostMapping(API_PREFIX + "/deleteListByParcelListIds")
void deleteListByParcelListIds(@RequestBody List<Long> deleteParcelListIds);
}

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

@ -65,4 +65,7 @@ public interface IDistributionParcelNumberClient {
@GetMapping(API_PREFIX+"/addHandleQuantity")
void addHandleQuantity(@RequestParam Long packageId, @RequestParam int num);
@GetMapping(API_PREFIX+"/updateListByPracelListIds")
void updateListByPracelListIds(@RequestParam List<Long> updateNumberIds);
}

4
blade-service-api/logpm-factory-data-api/src/main/java/com/logpm/factorydata/vo/PushData.java

@ -35,5 +35,9 @@ public class PushData implements Serializable {
* 当前仓库名称
*/
private String warehouseName;
/**
* 目的仓
*/
private String destinationWarehouse;
}

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillDetailClient.java

@ -65,6 +65,10 @@ public interface IWarehouseWaybillDetailClient {
@PostMapping(API_PREFIX+"/addEntity")
void addEntity(@RequestBody WarehouseWayBillDetail warehouseWayBillDetail);
@PostMapping(API_PREFIX+"/addEntityReturnId")
Long addEntityReturnId(@RequestBody WarehouseWayBillDetail warehouseWayBillDetail);
@PostMapping(API_PREFIX+"/findByWaybillIds")
List<WarehouseWayBillDetail> findByWaybillIds(@RequestBody List<Long> waybillIds);
@PostMapping(API_PREFIX+"/deleteByWaybillNo")

9
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java

@ -175,10 +175,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
Long waybillId = null;
Integer dealType = abnormalRecordDTO.getDealType();
List<ZeroPackageDTO> zeroPackageDTOS = abnormalRecordDTO.getZeroPackageDTOS();
if(CollUtil.isEmpty(zeroPackageDTOS)){
log.warn("################dealAbnormal: 品类信息不存在");
return R.fail(405,"品类信息不存在");
}
Integer num = abnormalRecordEntity.getNum();
Long carsLoadScanId = abnormalRecordEntity.getAssociationId();
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanClient.findEntityById(carsLoadScanId);
@ -203,6 +200,10 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
abnormalRecordEntity.setRemark("差异件数退回原仓");
}else if(dealType.equals(6)){
List<PackageData> packageDataList = new ArrayList<>();
if(CollUtil.isEmpty(zeroPackageDTOS)){
log.warn("################dealAbnormal: 品类信息不存在");
return R.fail(405,"品类信息不存在");
}
//入库本仓
Integer enterNum = abnormalRecordDTO.getNum();
//把scanZeroDetailEntityList转化成以packageId为key的map

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

@ -585,4 +585,11 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
public Map<String, Object> findOrderInfoByOrderPackageCode(String orderPackageCode, Long warehouseId) {
return distributionParcelListService.findOrderInfoByOrderPackageCode(orderPackageCode,warehouseId);
}
@Override
public void deleteListByParcelListIds(List<Long> deleteParcelListIds) {
distributionParcelListService.deleteListByParcelListIds(deleteParcelListIds);
distributionParcelNumberService.deleteListByParcelListIds(deleteParcelListIds);
}
}

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

@ -82,4 +82,9 @@ public class DistributionParcelNumberClient implements IDistributionParcelNumber
distributionParcelNumberService.addZeroQuantity(packageId, num);
}
@Override
public void updateListByPracelListIds(List<Long> updateNumberIds) {
distributionParcelNumberService.updateListByPracelListIds(updateNumberIds);
}
}

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

@ -313,4 +313,6 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
void clearWaybillInfoByParceListIds(@Param("parceListIds") List<Long> parceListIds);
Map<String, Object> findOrderInfoByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode, @Param("warehouseId") Long warehouseId);
void deleteListByParcelListIds(@Param("parceListIds") List<Long> deleteParcelListIds);
}

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

@ -1962,4 +1962,12 @@
</update>
<delete id="deleteListByParcelListIds">
delete from logpm_distribution_parcel_list
where id in
<foreach collection="parceListIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>

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

@ -76,4 +76,6 @@ public interface DistributionParcelNumberMapper extends BaseMapper<DistributionP
Integer augmentSignForNum(@Param("packageId") Long id,@Param("stockArticleId") Long stockArticleId,@Param("quantity") Integer quantity);
void addZeroQuantity(@Param("packageId") Long packageId, @Param("num") int num);
void deleteListByParcelListIds(@Param("parceListIds") List<Long> deleteParcelListIds);
}

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

@ -86,4 +86,12 @@
parcel_list_id = #{packageId}
</update>
<delete id="deleteListByParcelListIds">
delete from logpm_distribution_parcel_number
where parcel_list_id in
<foreach collection="parceListIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</delete>
</mapper>

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

@ -286,4 +286,6 @@ public interface IDistributionParcelListService extends BaseService<Distribution
Map<String, Object> findOrderInfoByOrderPackageCode(String orderPackageCode, Long warehouseId);
void updateEntityByOpenOrderByAdvanceIds(UpdateOrderDTO updateOrderDTO);
void deleteListByParcelListIds(List<Long> deleteParcelListIds);
}

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

@ -81,4 +81,7 @@ public interface IDistributionParcelNumberService extends BaseService<Distributi
void addZeroQuantity(Long packageId, int num);
void deleteListByParcelListIds(List<Long> deleteParcelListIds);
void updateListByPracelListIds(List<Long> updateNumberIds);
}

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

@ -1520,4 +1520,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionStockArticleService.updateBatchById(stockArticleEntities);
}
}
@Override
public void deleteListByParcelListIds(List<Long> deleteParcelListIds) {
baseMapper.deleteListByParcelListIds(deleteParcelListIds);
}
}

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

@ -17,6 +17,7 @@
package com.logpm.distribution.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.DistributionParcelNumberDTO;
@ -38,7 +39,10 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
* 订单零担包件数量记录 服务实现类
@ -178,4 +182,29 @@ public class DistributionParcelNumberServiceImpl extends BaseServiceImpl<Distrib
baseMapper.addZeroQuantity(packageId,num);
}
@Override
public void deleteListByParcelListIds(List<Long> deleteParcelListIds) {
baseMapper.deleteListByParcelListIds(deleteParcelListIds);
}
@Override
public void updateListByPracelListIds(List<Long> updateNumberIds) {
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(updateNumberIds);
//转化成以id为key的Map
Map<Long, DistributionParcelListEntity> parcelListMap = distributionParcelListEntities.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, parcelListEntity -> parcelListEntity));
QueryWrapper<DistributionParcelNumberEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.in("parcel_list_id", updateNumberIds);
List<DistributionParcelNumberEntity> distributionParcelNumberEntities = baseMapper.selectList(queryWrapper);
distributionParcelNumberEntities.forEach(p->{
Long parcelListId = p.getParcelListId();
DistributionParcelListEntity parcelList = parcelListMap.get(parcelListId);
if(!Objects.isNull(parcelList)){
p.setQuantity(parcelList.getQuantity());
p.setHandQuantity(parcelList.getQuantity());
}
});
updateBatchById(distributionParcelNumberEntities);
}
}

8
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml

@ -502,16 +502,16 @@
and ltcl.arrive_time &lt;= #{param.arriveTimeEnd}
</if>
<if test="param.carrierTimeStart != null ">
and ltcl.arrive_time &gt;= #{param.carrierTimeStart}
and ltcl.carrier_time &gt;= #{param.carrierTimeStart}
</if>
<if test="param.carrierTimeEnd != null ">
and ltcl.arrive_time &lt;= #{param.carrierTimeEnd}
and ltcl.carrier_time &lt;= #{param.carrierTimeEnd}
</if>
<if test="param.signTimeStart != null ">
and ltcl.arrive_time &gt;= #{param.signTimeStart}
and ltcl.sign_time &gt;= #{param.signTimeStart}
</if>
<if test="param.signTimeEnd != null ">
and ltcl.arrive_time &lt;= #{param.signTimeEnd}
and ltcl.sign_time &lt;= #{param.signTimeEnd}
</if>
group by ltcl.id
order by ltcl.create_time desc

189
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -2478,33 +2478,35 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
log.warn("#############updateWaybill: 运单已作废 waybillId={}", waybillId);
return R.fail(405, "运单已作废");
}
Integer checkStatus = waybillEntity.getCheckStatus();
if(checkStatus.equals(1)){
log.warn("#############updateWaybill: 运单已审核 waybillId={}", waybillId);
return R.fail(405, "运单已审核,不能改单");
}
Integer waybillType = waybillEntity.getWaybillType();
if(waybillType.equals(2)){
//零担改单限制
Long departureWarehouseId = waybillEntity.getDepartureWarehouseId();
Long destinationWarehouseId = waybillEntity.getDestinationWarehouseId();
Integer totalCount = waybillEntity.getTotalCount();
DistributionStockArticleEntity startStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, departureWarehouseId);
if(Objects.isNull(startStockArticleEntity)){
log.warn("#############updateWaybill: 订单信息不存在 waybillId={}", waybillId);
return R.fail(405, "订单信息不存在");
}
Integer handQuantity = startStockArticleEntity.getHandQuantity();
if(NumberUtil.equals(handQuantity,0)){
DistributionStockArticleEntity endStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, destinationWarehouseId);
if(Objects.isNull(endStockArticleEntity)){
DistributionStockArticleEntity endStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, destinationWarehouseId);
if(Objects.isNull(endStockArticleEntity)){
DistributionStockArticleEntity startStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(waybillNo, departureWarehouseId);
if(Objects.isNull(startStockArticleEntity)){
log.warn("#############updateWaybill: 订单信息不存在! waybillId={}", waybillId);
return R.fail(405, "订单信息不存在!");
}
handQuantity = endStockArticleEntity.getHandQuantity();
Integer handQuantity = startStockArticleEntity.getHandQuantity();
if(!NumberUtil.equals(handQuantity,totalCount)){
log.warn("#############updateWaybill: 目的仓数据还未完全到达 waybillId={}", waybillId);
return R.fail(405, "目的仓数据还未完全到达");
log.warn("#############updateWaybill: 始发仓数据已发运 waybillId={}", waybillId);
return R.fail(405, "始发仓数据已发运");
}
}else{
Integer handQuantity = endStockArticleEntity.getHandQuantity();
if(!NumberUtil.equals(handQuantity,totalCount)){
log.warn("#############updateWaybill: 始发仓数据已发运 waybillId={}", waybillId);
return R.fail(405, "始发仓数据已发运");
log.warn("#############updateWaybill: 目的仓数据还未完全到达 waybillId={}", waybillId);
return R.fail(405, "目的仓数据还未完全到达");
}
}
}
@ -2637,10 +2639,22 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
}else if(waybillType == 2){
List<WaybillDetailDTO> addList = openOrderDTO.getAddList();
//把addList中updateType=1的放入一个新的List
List<WaybillDetailDTO> addNewList = addList.stream().filter(waybillDetailDTO -> waybillDetailDTO.getUpdateType() == 1).collect(Collectors.toList());
List<DistributionStockArticleEntity> orderList = distributionStockArticleClient.findListByWaybillNumber(waybillNo);
orderList.forEach(stockArticleEntity -> {
stockArticleEntity.setMallId(consigneeId);
stockArticleEntity.setDescriptionGoods(waybillEntity.getGoodsName());
stockArticleEntity.setTotalNumber(totalCount);
Integer handQuantity = stockArticleEntity.getHandQuantity();
if(handQuantity != 0){
stockArticleEntity.setHandQuantity(totalCount);
}
if(!Objects.isNull(basicdataClientEntity)){
stockArticleEntity.setMallCode(basicdataClientEntity.getClientCode());
}else{
@ -2663,18 +2677,53 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
});
List<WaybillDetailDTO> removeList = openOrderDTO.getRemoveList();
List<Long> updateNumberIds = new ArrayList<>();
//把addList中updateType=2的元素的id放入一个新的List
List<WaybillDetailDTO> updateList = addList.stream().filter(waybillDetailDTO -> waybillDetailDTO.getUpdateType() == 2).collect(Collectors.toList());
//把updateList转化成以id为key的Map
Map<Long, WaybillDetailDTO> updateMap = updateList.stream().collect(Collectors.toMap(WaybillDetailDTO::getId, Function.identity()));
List<Long> deleteParcelListIds = new ArrayList<>();
List<Long> removeIds = new ArrayList<>();
if(CollUtil.isNotEmpty(removeList)){
//把removeList中所有id放入一个List
List<Long> list = removeList.stream().map(WaybillDetailDTO::getId).collect(Collectors.toList());
removeIds.addAll(list);
}
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListClient.findByWaybillNumber(waybillNo);
parcelListEntityList.forEach(parcelListEntity -> {
Long nowWarehouseId = parcelListEntity.getWarehouseId();
parcelListEntity.setSendWarehouseId(departureWarehouseId);
parcelListEntity.setSendWarehouseName(departureWarehouseName);
parcelListEntity.setAcceptWarehouseId(destinationWarehouseId);
parcelListEntity.setAcceptWarehouseName(destinationWarehouseName);
if(nowWarehouseId.equals(destinationWarehouseId)){
parcelListEntity.setIsTransfer(0);
Long advanceId = parcelListEntity.getAdvanceId();
Long id = parcelListEntity.getId();
if(removeIds.contains(advanceId)){
deleteParcelListIds.add(id);
}else{
parcelListEntity.setIsTransfer(1);
WaybillDetailDTO waybillDetailDTO = updateMap.get(advanceId);
if(!Objects.isNull(waybillDetailDTO)){
parcelListEntity.setFirsts(waybillDetailDTO.getGoodsName());
Integer quantity = parcelListEntity.getQuantity();
if(quantity != 0){
parcelListEntity.setQuantity(waybillDetailDTO.getNum());
}
updateNumberIds.add(id);
}
parcelListEntity.setSendWarehouseId(departureWarehouseId);
parcelListEntity.setSendWarehouseName(departureWarehouseName);
parcelListEntity.setAcceptWarehouseId(destinationWarehouseId);
parcelListEntity.setAcceptWarehouseName(destinationWarehouseName);
if(nowWarehouseId.equals(destinationWarehouseId)){
parcelListEntity.setIsTransfer(0);
}else{
parcelListEntity.setIsTransfer(1);
}
}
});
@ -2685,6 +2734,80 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
distributionParcelListClient.updateList(parcelListEntityList);
}
List<DistributionParcelNumberEntity> addNewNumberList = new ArrayList<>();
orderList.forEach(stockArticleEntity -> {
Integer handQuantity = stockArticleEntity.getHandQuantity();
addNewList.forEach(waybillDetailDTO->{
DistributionParcelListEntity entity = new DistributionParcelListEntity();
entity.setBrandName(stockArticleEntity.getBrand());
entity.setDealerName(stockArticleEntity.getConsigneeUnit());
entity.setFirsts(waybillDetailDTO.getGoodsName());
Long warehouseId1 = stockArticleEntity.getWarehouseId();
entity.setWarehouseId(warehouseId1);
entity.setWarehouse(stockArticleEntity.getWarehouse());
if(handQuantity != 0){
entity.setQuantity(waybillDetailDTO.getNum());
}else{
entity.setQuantity(0);
}
entity.setConditions(3);
entity.setStockArticleId(stockArticleEntity.getId());
entity.setOrderCode(stockArticleEntity.getOrderCode());
entity.setOrderPackageStatus("20");
entity.setOrderPackageFreezeStatus("10");
entity.setOrderPackageGroundingStatus("10");
entity.setOrderPackageStockupStatus("10");
entity.setOrderPackageReservationStatus("10");
entity.setOrderPackageLoadingStatus("10");
entity.setWaybillId(waybillId);
entity.setWaybillNumber(waybillNo);
entity.setIsZero("1");
entity.setAdvanceId(waybillDetailDTO.getId());
entity.setWarehouseEntryTimeEnd(new Date());
entity.setSendWarehouseId(departureWarehouseId);
entity.setSendWarehouseName(departureWarehouseName);
entity.setAcceptWarehouseId(destinationWarehouseId);
entity.setAcceptWarehouseName(destinationWarehouseName);
if (departureWarehouseId.equals(destinationWarehouseId)) {
entity.setIsTransfer(0);
} else {
entity.setIsTransfer(1);
}
Long aLong = distributionParcelListClient.addReturnId(entity);
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setStockArticleId(entity.getStockArticleId());
parcelNumberEntity.setWarehouseId(entity.getWarehouseId());
parcelNumberEntity.setParcelListId(aLong);
parcelNumberEntity.setHandQuantity(entity.getQuantity());
parcelNumberEntity.setQuantity(entity.getQuantity());
parcelNumberEntity.setDeliveryQuantity(0);
parcelNumberEntity.setSigninQuantity(0);
parcelNumberEntity.setOutboundQuantity(0);
addNewNumberList.add(parcelNumberEntity);
});
});
if(CollUtil.isNotEmpty(addNewNumberList)){
distributionParcelNumberClient.addBatch(addNewNumberList);
}
if(CollUtil.isNotEmpty(deleteParcelListIds)){
distributionParcelListClient.deleteListByParcelListIds(deleteParcelListIds);
}
if(CollUtil.isNotEmpty(updateNumberIds)){
distributionParcelNumberClient.updateListByPracelListIds(updateNumberIds);
}
}
trunklineWaybillPackageService.updateWaybillStatus(waybillEntity);
@ -4842,10 +4965,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
if (StringUtil.isNotBlank(removeMsg)) {
stringBuilder.append("明细移除:").append(removeMsg).append(";");
}
Integer totalNum = 0;
Set<String> goodsList = new HashSet<>();
List<WaybillDetailDTO> addList = openOrderDTO.getAddList();
for (WaybillDetailDTO waybillDetailDTO : addList) {
Integer num1 = waybillDetailDTO.getNum();
String goodsName = waybillDetailDTO.getGoodsName();
goodsList.add(goodsName);
totalNum = totalNum + num1;
Integer updateType = waybillDetailDTO.getUpdateType();
if (1 == updateType) {
@ -4867,7 +4994,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
warehouseWayBillDetail.setSystemDeliveryChargeType(waybillDetailDTO.getSystemDeliveryChargeType());
warehouseWayBillDetail.setSystemPickupChargeType(waybillDetailDTO.getSystemPickupChargeType());
warehouseWayBillDetail.setSystemWarehouseChargeType(waybillDetailDTO.getSystemWarehouseChargeType());
warehouseWaybillDetailClient.addEntity(warehouseWayBillDetail);
Long waybillDetailId = warehouseWaybillDetailClient.addEntityReturnId(warehouseWayBillDetail);
waybillDetailDTO.setId(waybillDetailId);
stringBuilder.append("明细新增:").append(warehouseWayBillDetail.getProductName()).append(" 数量 ").append(waybillDetailDTO.getNum()).append(" 单价 ").append(waybillDetailDTO.getPrice()).append(";");
} else if (2 == updateType) {
@ -4944,12 +5073,14 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
warehouseWaybillDetailClient.updateEntityById(warehouseWayBillDetail);
}
}
waybillEntity.setGoodsName(String.join(",",goodsList));
Integer newTotalCount = openOrderDTO.getTotalCount();
Integer totalCount = waybillEntity.getTotalCount();
if (!ObjectUtil.equals(totalCount,newTotalCount)) {
stringBuilder.append("货物总数:").append(totalCount).append("-->").append(newTotalCount).append(";");
waybillEntity.setTotalCount(newTotalCount);
if (!ObjectUtil.equals(totalCount,totalNum)) {
stringBuilder.append("货物总数:").append(totalCount).append("-->").append(totalNum).append(";");
waybillEntity.setTotalCount(totalNum);
waybillEntity.setStockCount(totalNum);
}
BigDecimal newTotalFreight = openOrderDTO.getTotalFreight();
@ -5210,7 +5341,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
entity.setWarehouse(distributionStockArticleEntity.getWarehouse());
entity.setQuantity(warehouseWayBillDetail.getNum());
entity.setTrainNumber(warehouseWaybill.getCustomerTrain());
entity.setConditions(1);
entity.setConditions(3);
entity.setStockArticleId(orderId);
entity.setOrderCode(distributionStockArticleEntity.getOrderCode());
entity.setOrderPackageStatus("20");

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

@ -37,12 +37,95 @@ import com.logpm.factorydata.util.FactoryDataMessageSender;
import com.logpm.factorydata.vo.NodePushMsg;
import com.logpm.factorydata.vo.PushData;
import com.logpm.trunkline.bean.Resp;
import com.logpm.trunkline.dto.*;
import com.logpm.trunkline.entity.*;
import com.logpm.trunkline.dto.BatchUnloadDTO;
import com.logpm.trunkline.dto.InComingDTO;
import com.logpm.trunkline.dto.LoadCarsDTO;
import com.logpm.trunkline.dto.LoadScanBrandDTO;
import com.logpm.trunkline.dto.LoadingPackageDTO;
import com.logpm.trunkline.dto.LoadingZeroDTO;
import com.logpm.trunkline.dto.OrderStatusDTO;
import com.logpm.trunkline.dto.ProductInfoDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadDTO;
import com.logpm.trunkline.dto.TrunklineCarsLoadLineDTO;
import com.logpm.trunkline.dto.TrunklineCarsOrderDTO;
import com.logpm.trunkline.dto.UnloadPackageDTO;
import com.logpm.trunkline.dto.UnloadZeroDTO;
import com.logpm.trunkline.dto.WaybillLogDTO;
import com.logpm.trunkline.dto.ZeroPackageDTO;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadContractEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadFinanceEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLineEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLinePhotoEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadLogEntity;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.entity.TrunklineCarsOrderEntity;
import com.logpm.trunkline.entity.TrunklineCarsUnloadLogEntity;
import com.logpm.trunkline.entity.TrunklineCostShareRecordEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignOrderEntity;
import com.logpm.trunkline.entity.TrunklineLoadSignPhotoEntity;
import com.logpm.trunkline.entity.TrunklineScanZeroDetailEntity;
import com.logpm.trunkline.entity.TrunklineWaybillOrderEntity;
import com.logpm.trunkline.feign.ITrunklinePackageTrackLogClient;
import com.logpm.trunkline.mapper.TrunklineCarsLoadMapper;
import com.logpm.trunkline.service.*;
import com.logpm.trunkline.vo.*;
import com.logpm.trunkline.service.ICarsLoadAsyncService;
import com.logpm.trunkline.service.IInComingService;
import com.logpm.trunkline.service.IOpenOrderAsyncService;
import com.logpm.trunkline.service.IPackageTrackLogAsyncService;
import com.logpm.trunkline.service.ITrunklineAdvanceDetailService;
import com.logpm.trunkline.service.ITrunklineCarsLoadContractService;
import com.logpm.trunkline.service.ITrunklineCarsLoadFinanceService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLinePhotoService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLineService;
import com.logpm.trunkline.service.ITrunklineCarsLoadLogService;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import com.logpm.trunkline.service.ITrunklineCarsLoadingLogService;
import com.logpm.trunkline.service.ITrunklineCarsOrderService;
import com.logpm.trunkline.service.ITrunklineCarsSignLogService;
import com.logpm.trunkline.service.ITrunklineCarsUnloadLogService;
import com.logpm.trunkline.service.ITrunklineCostShareRecordService;
import com.logpm.trunkline.service.ITrunklineLoadSignOrderService;
import com.logpm.trunkline.service.ITrunklineLoadSignPhotoService;
import com.logpm.trunkline.service.ITrunklineScanZeroDetailService;
import com.logpm.trunkline.service.ITrunklineWaybillOrderService;
import com.logpm.trunkline.service.ITrunklineWaybillPackageService;
import com.logpm.trunkline.service.ITrunklineWaybillTrackService;
import com.logpm.trunkline.vo.CarsLoadAllOrderVO;
import com.logpm.trunkline.vo.CarsLoadOrderInfoVO;
import com.logpm.trunkline.vo.CarsLoadScanAbnormalVO;
import com.logpm.trunkline.vo.CarsLoadWaybillInfoVO;
import com.logpm.trunkline.vo.CustmoerUnloadNumVO;
import com.logpm.trunkline.vo.GoodsLoadingNumVO;
import com.logpm.trunkline.vo.HasNotFinalNodeIdDataVO;
import com.logpm.trunkline.vo.LoadScanFinalNodeIdVO;
import com.logpm.trunkline.vo.LoadScanOrderVO;
import com.logpm.trunkline.vo.LoadZeroListVO;
import com.logpm.trunkline.vo.LoadingDetailExportVO;
import com.logpm.trunkline.vo.LoadingListGoodsVO;
import com.logpm.trunkline.vo.LoadingListMainVO;
import com.logpm.trunkline.vo.NodeNumDataVO;
import com.logpm.trunkline.vo.OrderCodeNumVO;
import com.logpm.trunkline.vo.OrderScanDetailVO;
import com.logpm.trunkline.vo.SignOrderDetailVO;
import com.logpm.trunkline.vo.SignPackageVO;
import com.logpm.trunkline.vo.SignScanOrderVO;
import com.logpm.trunkline.vo.TripartiteTransferVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadLoadingListVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadScanVO;
import com.logpm.trunkline.vo.TrunklineCarsLoadVO;
import com.logpm.trunkline.vo.TrunklineCarsOrderVO;
import com.logpm.trunkline.vo.TrunklineLoadSignOrderVO;
import com.logpm.trunkline.vo.TrunklineScanZeroDetailVO;
import com.logpm.trunkline.vo.UnloadPackageVO;
import com.logpm.trunkline.vo.UnloadScanOrderVO;
import com.logpm.trunkline.vo.UnloadZeroVO;
import com.logpm.trunkline.vo.WaybillCarsLoadVO;
import com.logpm.trunkline.vo.ZeroNumVO;
import com.logpm.trunkline.vo.ZeroPackageVO;
import com.logpm.trunkline.vo.ZeroSuppleListVO;
import com.logpm.trunkline.vo.ZeroSuppleVO;
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
@ -56,7 +139,11 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.annotations.RepeatSubmit;
import org.springblade.common.constant.*;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.carsload.CarsLoadLogTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
@ -76,7 +163,18 @@ import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -2899,7 +2997,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
loadCarsDTO.setArriveTimeStart(CommonUtil.getStartByDateStr(loadCarsDTO.getArriveTimeStartStr()));
loadCarsDTO.setArriveTimeEnd(CommonUtil.getEndByDateStr(loadCarsDTO.getArriveTimeEndStr()));
//承运时间
loadCarsDTO.setCarrierTimeStart(CommonUtil.getStartByDateStr(loadCarsDTO.getCarrierTimeStartStr()));
loadCarsDTO.setCarrierTimeEnd(CommonUtil.getEndByDateStr(loadCarsDTO.getCarrierTimeEndStr()));
@ -3464,6 +3562,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long waybillId = null;
String waybillNo = null;
String orderCode = null;
String destinationWarehouse = null;
String brandName = null;
Integer isData = 1;
Integer isAbnormal = 0;
@ -3575,6 +3674,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (!Objects.isNull(waybillEntity)) {
waybillId = waybillEntity.getId();
waybillNo = waybillEntity.getWaybillNo();
destinationWarehouse = waybillEntity.getDestinationWarehouseName();
}
carsLoadScanEntity.setWaybillId(waybillId);
carsLoadScanEntity.setWaybillNo(waybillNo);
@ -3616,6 +3716,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//补全数据信息
Long packageId = parcelListEntity.getId();
waybillNo = parcelListEntity.getWaybillNumber();
destinationWarehouse = parcelListEntity.getAcceptWarehouseName();
orderCode = parcelListEntity.getOrderCode();
brandName = parcelListEntity.getBrandName();
waybillId = parcelListEntity.getWaybillId();
@ -3717,16 +3818,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// 推送包件装车数据到工厂
pushFactoryOrderData(warehouseId, orderPackageCode, orderCode);
try {
JSONObject main = new JSONObject();
main.put("trainNumber",loadCode);
main.put("waybillNumber",waybillNo);
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
.address("在【" + warehouseName + "】出库")
.brand(BrandEnums.getByValue(brandName))
.node(WorkNodeEnums.INITIAL_WAREHOUSE_LOADING)
.main(JSONUtil.toJsonStr(main))
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.orderCode(orderCode)
.warehouseName(warehouseName)
.destinationWarehouse(destinationWarehouse)
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
@ -5427,7 +5533,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if(CollUtil.isNotEmpty(carsLoadScanIdList)){
List<TrunklineScanZeroDetailVO> zeroDetailVOList = scanZeroDetailService.findListByCarsLoadScanIds(carsLoadScanIdList);
//把zeroDetailVOList所有元素通过id分组
Map<Long, List<TrunklineScanZeroDetailVO>> zeroDetailVOMap = zeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getId));
Map<Long, List<TrunklineScanZeroDetailVO>> zeroDetailVOMap = zeroDetailVOList.stream().collect(Collectors.groupingBy(TrunklineScanZeroDetailVO::getScanId));
for (UnloadZeroDTO unloadZeroDTO : unloadZeroList) {
Long carsLoadScanId = unloadZeroDTO.getCarsLoadScanId();
@ -5808,6 +5914,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Map<String, Object> map = new HashMap<>();
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
JSONObject main = new JSONObject();
main.put("trainNumber", entity.getTrainNumber());
main.put("waybillNumber", entity.getWaybillNumber());
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
@ -5817,11 +5926,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.address("在【" + warehouseName + "】入库")
.brand(BrandEnums.getByValue(entity.getBrandName()))
.node(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE)
.main(JSONUtil.toJsonStr(main))
.content(Collections.singletonList(PushData.builder()
.packageCode(entity.getOrderPackageCode())
.warehouseName(warehouseName)
.waybillNumber(entity.getWaybillNumber())
.orderCode(entity.getOrderCode())
.destinationWarehouse(entity.getAcceptWarehouseName())
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
@ -7093,16 +7204,21 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
// 推送包件装车信息到工厂
pushFactoryOrderData(warehouseId, orderPackageCode, orderCode);
try {
JSONObject main = new JSONObject();
main.put("trainNumber",carsNo);
main.put("waybillNumber",waybillNo);
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
.address("在【" + warehouseName + "】出库")
.brand(BrandEnums.getByValue(parcelListEntity.getBrandName()))
.node(WorkNodeEnums.INITIAL_WAREHOUSE_LOADING)
.main(JSONUtil.toJsonStr(main))
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.orderCode(orderCode)
.warehouseName(warehouseName)
.destinationWarehouse(parcelListEntity.getAcceptWarehouseName())
.build()))
.build();
factoryDataMessageSender.sendNodeDataByBrand(nodePushMsg);
@ -9319,6 +9435,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
JSONObject main = new JSONObject();
main.put("trainNumber", parcelListEntity.getTrainNumber());
main.put("waybillNumber", parcelListEntity.getWaybillNumber());
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
@ -9327,10 +9446,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.endWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.address("在【" + warehouseName + "】入库")
.brand(BrandEnums.getByValue(distributionParcelListEntity.getBrandName()))
.main(JSONUtil.toJsonStr(main))
.node(WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE)
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.warehouseName(warehouseName)
.destinationWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.orderCode(orderCode)
.build()))
.build();
@ -10001,6 +10122,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
map.put("messageData", JSONUtil.toJsonStr(orderStatusDTO));
rabbitTemplate.convertAndSend(RabbitConstant.HWY_ORDER_STATUS_EXCHANGE, RabbitConstant.HWY_ORDER_STATUS_ROUTING, map);
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId);
JSONObject main = new JSONObject();
main.put("trainNumber", parcelListEntity.getTrainNumber());
main.put("waybillNumber", parcelListEntity.getWaybillNumber());
NodePushMsg nodePushMsg = NodePushMsg.builder()
.operator(AuthUtil.getNickName())
.operatorTime(new Date())
@ -10013,6 +10137,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
.content(Collections.singletonList(PushData.builder()
.packageCode(orderPackageCode)
.warehouseName(warehouseName)
.destinationWarehouse(ObjectUtil.isNotEmpty(parcelListEntity) ? parcelListEntity.getAcceptWarehouseName():"")
.orderCode(orderCode)
.build()))
.build();

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillDetailClient.java

@ -53,6 +53,12 @@ public class WarehouseWaybillDetailClient implements IWarehouseWaybillDetailClie
warehouseWayBillDetailService.save(warehouseWayBillDetail);
}
@Override
public Long addEntityReturnId(WarehouseWayBillDetail warehouseWayBillDetail) {
warehouseWayBillDetailService.save(warehouseWayBillDetail);
return warehouseWayBillDetail.getId();
}
@Override
public List<WarehouseWayBillDetail> findByWaybillIds(List<Long> waybillIds) {
return warehouseWayBillDetailService.findByWaybillIds(waybillIds);

Loading…
Cancel
Save