Browse Source

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

master
zhenghaoyu 8 months ago
parent
commit
81e10aa919
  1. 11
      blade-biz-common/src/main/java/org/springblade/common/constant/DistributionTypeConstant.java
  2. 8
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalRecordEntity.java
  3. 3
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/feign/IAftersalesAbnormalRecordClient.java
  4. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  5. 2
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/dto/MtPushDataDTO.java
  6. 3
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtFactoryOrderMain.java
  7. 12
      blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java
  8. 10
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java
  9. 5
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/feign/AftersalesAbnormalRecordClient.java
  10. 162
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java
  11. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java
  12. 24
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  13. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  14. 4
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java
  15. 3
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/CentralStkInConfirmVO.java
  16. 4
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/CentralStkInVO.java
  17. 4
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/SignForConfirmPackageVO.java
  18. 4
      blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/SignForVO.java
  19. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java
  20. 4
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderMainDTO.java
  21. 1
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml
  22. 2
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java
  23. 46
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java
  24. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java
  25. 12
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java
  26. 13
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineCarsLoadScanClient.java
  27. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.java
  28. 11
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml
  29. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineCarsLoadScanService.java
  30. 71
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/CarsLoadAsyncServiceImpl.java
  31. 10
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java
  32. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadScanServiceImpl.java
  33. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java
  34. 15
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java
  35. 176
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

11
blade-biz-common/src/main/java/org/springblade/common/constant/DistributionTypeConstant.java

@ -1,5 +1,7 @@
package org.springblade.common.constant;
import org.springblade.common.constant.driver.DriverApprovedDrivingModelConstant;
/**
* 配送类型枚举
* 对应码表 distribution_type
@ -43,4 +45,13 @@ public enum DistributionTypeConstant {
public void setValue(String value) {
this.value = value;
}
public static String getName(String value) {
for (DistributionTypeConstant t : DistributionTypeConstant.values()) {
if (t.getValue().equals(value)) {
return t.getName();
}
}
return null;
}
}

8
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesAbnormalRecordEntity.java

@ -35,7 +35,7 @@ public class AftersalesAbnormalRecordEntity extends TenantEntity {
private String type;
@ApiModelProperty(name = "异常类型 1无系统编码 2无装车计划 3无装车记录 4无卸车记录",notes = "")
@ApiModelProperty(name = "异常类型 1无系统编码 2无装车计划 3无装车记录 4无卸车记录 5卸车数量异常",notes = "")
private String abnormalType;
@ApiModelProperty(name = "车类型 1干线",notes = "")
@ -96,6 +96,12 @@ public class AftersalesAbnormalRecordEntity extends TenantEntity {
@ApiModelProperty(name = "关联类型",notes = "")
private Integer associationType;
@ApiModelProperty(name = "是否是零担",notes = "")
private Integer isZero;
@ApiModelProperty(name = "数量",notes = "")
private Integer num;
}

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

@ -26,7 +26,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
import java.util.Map;
/**
* 货位 Feign接口类
@ -57,4 +56,6 @@ public interface IAftersalesAbnormalRecordClient {
@PostMapping(API_PREFIX+"/updateList")
void updateList(@RequestBody List<AftersalesAbnormalRecordEntity> abnormalRecordEntities);
@PostMapping(API_PREFIX+"/addAbnormalRecordList")
void addAbnormalRecordList(@RequestBody List<AftersalesAbnormalRecordEntity> abnormalRecordEntities);
}

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

@ -201,4 +201,7 @@ public interface IDistributionParcelListClient {
@PostMapping(API_PREFIX + "/findAllParcelListByAdvanceIds")
List<DistributionParcelListEntity> findAllParcelListByAdvanceIds(@RequestBody List<Long> advanceIds);
@PostMapping(API_PREFIX + "/addZeroParcelList")
void addZeroParcelList(@RequestBody List<DistributionParcelListEntity> addParcelListEntityList);
}

2
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/dto/MtPushDataDTO.java

@ -9,6 +9,8 @@ public class MtPushDataDTO implements Serializable {
/** 发货单编号 */
private String senderCode;
/** OMS */
private String oms;
/** 订单编号 */
private String orderCode;
/** 包件码 */

3
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/mt/entity/MtFactoryOrderMain.java

@ -20,6 +20,9 @@ public class MtFactoryOrderMain extends BaseEntity {
@ApiModelProperty(value = "供应基地")
private String siteName;
@ApiModelProperty(value = "OMS")
private String oms;
//@JsonProperty("发货单编号")
@ApiModelProperty(value = "发货单编号")
private String invoiceOrderCode;

12
blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/StatisticsDistributionPackageEntity.java

@ -48,6 +48,18 @@ public class StatisticsDistributionPackageEntity extends TenantEntity {
@ApiModelProperty(value = "仓库id")
private Long warehouseId;
/**
* 品牌id
*/
@ApiModelProperty(value = "品牌id")
private Long brandId;
/**
* 客户id
*/
@ApiModelProperty(value = "客户id")
private Long consigneeId;
/**
* 仓库名称
*/

10
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/feign/ITrunklineCarsLoadScanClient.java

@ -1,9 +1,12 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(
@ -22,6 +25,13 @@ public interface ITrunklineCarsLoadScanClient {
@GetMapping(API_PREFIX+"/adnormalHasStock")
R adnormalHasStock(@RequestParam Long carsLoadScanId, @RequestParam Long warehouseId);
@GetMapping(API_PREFIX+"/findEntityById")
TrunklineCarsLoadScanEntity findEntityById(@RequestParam Long associationId);
@PostMapping(API_PREFIX+"/updateEntity")
void updateEntity(@RequestBody TrunklineCarsLoadScanEntity carsLoadScanEntity);
// @PostMapping(API_PREFIX+"/addAdvanceReturnId")
// Long addAdvanceReturnId(@RequestBody TrunklineAdvanceEntity trunklineAdvanceEntity);

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

@ -49,4 +49,9 @@ public class AftersalesAbnormalRecordClient implements IAftersalesAbnormalRecord
public void updateList(List<AftersalesAbnormalRecordEntity> abnormalRecordEntities) {
aftersalesAbnormalRecordService.updateBatchById(abnormalRecordEntities);
}
@Override
public void addAbnormalRecordList(List<AftersalesAbnormalRecordEntity> abnormalRecordEntities) {
aftersalesAbnormalRecordService.saveBatch(abnormalRecordEntities);
}
}

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

@ -9,6 +9,11 @@ import com.logpm.aftersales.mapper.AftersalesAbnormalRecordMapper;
import com.logpm.aftersales.service.IAftersalesAbnormalRecordService;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.feign.ITrunklineCarsLoadScanClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -16,6 +21,7 @@ import org.springblade.common.utils.CommonUtil;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -33,6 +39,10 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
private final IBasicdataWarehouseClient basicdataWarehouseClient;
private final IDistributionStockArticleClient stockArticleClient;
private final IDistributionParcelListClient parcelListClient;
@Override
public R findPageList(AbnormalRecordDTO abnormalRecordDTO) {
IPage<Object> page = new Page<>();
@ -117,6 +127,158 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl<Aftersa
abnormalRecordEntity.setRemark("已入库("+upWarehouseName+" "+AuthUtil.getNickName()+")");
}
}else if("5".equals(abnormalType)){
//零担卸车数量异常
Integer dealType = abnormalRecordDTO.getDealType();
Integer num = abnormalRecordEntity.getNum();
Long associationId = abnormalRecordEntity.getAssociationId();
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanClient.findEntityById(associationId);
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
String orderCode = carsLoadScanEntity.getOrderCode();
DistributionStockArticleEntity stockArticleEntity = stockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(!Objects.isNull(stockArticleEntity)){
Long stockId = stockArticleEntity.getId();
if(dealType.equals(5)){
//回退原仓库
stockArticleClient.addHandQuantity(stockId,num);
abnormalRecordEntity.setRemark("差异件数退回原仓");
}else if(dealType.equals(6)){
//入库本仓
Integer enterNum = abnormalRecordDTO.getNum();
if(enterNum > 0){
Date now = new Date();
int diff = num - enterNum;
Long warehouseId = abnormalRecordEntity.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId);
if(diff == 0){
//全部入库到本仓
DistributionStockArticleEntity currentStockArticleEntity = stockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(currentStockArticleEntity)){
currentStockArticleEntity = new DistributionStockArticleEntity();
Integer totalNumber = stockArticleEntity.getTotalNumber();
BeanUtil.copy(stockArticleEntity,currentStockArticleEntity);
currentStockArticleEntity.setId(null);
currentStockArticleEntity.setHandQuantity(enterNum);
currentStockArticleEntity.setWarehouseId(warehouseId);
currentStockArticleEntity.setWarehouse(warehouseEntity.getName());
currentStockArticleEntity.setWarehouseEntryTime(now);
currentStockArticleEntity.setCompleteSet(1);
currentStockArticleEntity.setOrderReceiveStatus("20");
if(totalNumber.equals(enterNum)){
currentStockArticleEntity.setCompleteSet(2);
currentStockArticleEntity.setOrderReceiveStatus("30");
}
currentStockArticleEntity.setStockupStatus("10");
currentStockArticleEntity.setReservationStatus("10");
currentStockArticleEntity.setOrderStatus("20");
currentStockArticleEntity.setGroundingStatus("10");
currentStockArticleEntity.setFreezeStatus("10");
currentStockArticleEntity.setWarehouseEntryTimeEnd(now);
currentStockArticleEntity.setSortingQuantity(0);
currentStockArticleEntity.setDeliveryQuantity(0);
currentStockArticleEntity.setTransferQuantity(0);
currentStockArticleEntity.setSigninQuantity(0);
currentStockArticleEntity.setAllocation(null);
currentStockArticleEntity.setTrays(null);
currentStockArticleEntity.setIncomingNum(enterNum);
Long orderId = stockArticleClient.addData(currentStockArticleEntity);
if(!Objects.isNull(orderId)){
List<DistributionParcelListEntity> addParcelListEntityList = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntityList = parcelListClient.findEntityListByOrderCode(orderCode, warehouseId);
parcelListEntityList.forEach(parcelListEntity -> {
DistributionParcelListEntity currentParcelListEntity = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity,currentParcelListEntity);
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
currentParcelListEntity.setId(null);
currentParcelListEntity.setGoodsAllocation(null);
currentParcelListEntity.setStockArticleId(orderId);
currentParcelListEntity.setPallet(null);
currentParcelListEntity.setWarehouseId(warehouseId);
currentParcelListEntity.setWarehouse(warehouseEntity.getName());
currentParcelListEntity.setIsTransfer(1);
if(acceptWarehouseId.equals(warehouseId)){
currentParcelListEntity.setIsTransfer(0);
}
addParcelListEntityList.add(currentParcelListEntity);
});
parcelListClient.addZeroParcelList(addParcelListEntityList);
}
}else{
stockArticleClient.addHandQuantity(currentStockArticleEntity.getId(),enterNum);
}
abnormalRecordEntity.setRemark("差异"+enterNum+"件数入库本仓");
}else{
//回退原仓库
stockArticleClient.addHandQuantity(stockId,diff);
//全部入库到本仓
DistributionStockArticleEntity currentStockArticleEntity = stockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId);
if(Objects.isNull(currentStockArticleEntity)){
currentStockArticleEntity = new DistributionStockArticleEntity();
Integer totalNumber = stockArticleEntity.getTotalNumber();
BeanUtil.copy(stockArticleEntity,currentStockArticleEntity);
currentStockArticleEntity.setId(null);
currentStockArticleEntity.setHandQuantity(enterNum);
currentStockArticleEntity.setWarehouseId(warehouseId);
currentStockArticleEntity.setWarehouse(warehouseEntity.getName());
currentStockArticleEntity.setWarehouseEntryTime(now);
currentStockArticleEntity.setCompleteSet(1);
currentStockArticleEntity.setOrderReceiveStatus("20");
if(totalNumber.equals(enterNum)){
currentStockArticleEntity.setCompleteSet(2);
currentStockArticleEntity.setOrderReceiveStatus("30");
}
currentStockArticleEntity.setStockupStatus("10");
currentStockArticleEntity.setReservationStatus("10");
currentStockArticleEntity.setOrderStatus("20");
currentStockArticleEntity.setGroundingStatus("10");
currentStockArticleEntity.setFreezeStatus("10");
currentStockArticleEntity.setWarehouseEntryTimeEnd(now);
currentStockArticleEntity.setSortingQuantity(0);
currentStockArticleEntity.setDeliveryQuantity(0);
currentStockArticleEntity.setTransferQuantity(0);
currentStockArticleEntity.setSigninQuantity(0);
currentStockArticleEntity.setAllocation(null);
currentStockArticleEntity.setTrays(null);
currentStockArticleEntity.setIncomingNum(enterNum);
Long orderId = stockArticleClient.addData(currentStockArticleEntity);
if(!Objects.isNull(orderId)){
List<DistributionParcelListEntity> addParcelListEntityList = new ArrayList<>();
List<DistributionParcelListEntity> parcelListEntityList = parcelListClient.findEntityListByOrderCode(orderCode, warehouseId);
parcelListEntityList.forEach(parcelListEntity -> {
DistributionParcelListEntity currentParcelListEntity = new DistributionParcelListEntity();
BeanUtil.copy(parcelListEntity,currentParcelListEntity);
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
currentParcelListEntity.setId(null);
currentParcelListEntity.setGoodsAllocation(null);
currentParcelListEntity.setStockArticleId(orderId);
currentParcelListEntity.setPallet(null);
currentParcelListEntity.setWarehouseId(warehouseId);
currentParcelListEntity.setWarehouse(warehouseEntity.getName());
currentParcelListEntity.setIsTransfer(1);
if(acceptWarehouseId.equals(warehouseId)){
currentParcelListEntity.setIsTransfer(0);
}
addParcelListEntityList.add(currentParcelListEntity);
});
parcelListClient.addZeroParcelList(addParcelListEntityList);
}
}else{
stockArticleClient.addHandQuantity(currentStockArticleEntity.getId(),enterNum);
}
abnormalRecordEntity.setRemark("差异"+enterNum+"件数入库本仓,原仓返回"+diff+"件");
}
carsLoadScanEntity.setScanStatus("2");
carsLoadScanEntity.setUnloadNum(carsLoadScanEntity.getUnloadNum()+enterNum);
trunklineCarsLoadScanClient.updateEntity(carsLoadScanEntity);
}
}
}
}
abnormalRecordEntity.setAbnormalStatus(1);
abnormalRecordEntity.setDealTime(new Date());

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceRouteServiceImpl.java

@ -97,12 +97,12 @@ public class BasicdataPriceRouteServiceImpl extends BaseServiceImpl<BasicdataPri
route.setEndCityId(vo.getEndCityId());
route.setEndProvinceId(vo.getEndProvinceId());
route.setEndCountyId(vo.getEndCountyId());
if(ObjectUtil.isEmpty(vo.getId())){
if(ObjectUtil.isNotEmpty(vo.getId())){
baseMapper.update(route,new UpdateWrapper<BasicdataPriceRouteEntity>().lambda()
.eq(BasicdataPriceRouteEntity::getId, route.getId())
.set(BasicdataPriceRouteEntity::getStartProvinceId, route.getStartProvinceId())
.set(BasicdataPriceRouteEntity::getStartCityId, route.getStartCityId())
.set(BasicdataPriceRouteEntity::getStartProvinceId, route.getStartProvinceId())
.set(BasicdataPriceRouteEntity::getStartCountyId, route.getStartCountyId())
.set(BasicdataPriceRouteEntity::getEndProvinceId, route.getEndProvinceId())
.set(BasicdataPriceRouteEntity::getEndCityId, route.getEndCityId())
.set(BasicdataPriceRouteEntity::getEndCountyId, route.getEndCountyId())

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

@ -27,8 +27,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.dto.FindParamterDTO;
import com.logpm.distribution.dto.OrderPackageDTO;
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.IDistributionParcelNumberService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionParcelListVO;
import lombok.AllArgsConstructor;
@ -61,6 +63,7 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
private final IDistributionParcelListService distributionParcelListService;
private final IDistributionStockArticleService distributionStockArticleService;
private final IDistributionParcelNumberService distributionParcelNumberService;
/**
* 查询包件信息
@ -468,4 +471,25 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
return list;
}
@Override
public void addZeroParcelList(List<DistributionParcelListEntity> addParcelListEntityList) {
distributionParcelListService.saveBatch(addParcelListEntityList);
List<DistributionParcelNumberEntity> addList = new ArrayList<>();
addParcelListEntityList.forEach(parcelListEntity -> {
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();
parcelNumberEntity.setStockArticleId(parcelListEntity.getStockArticleId());
parcelNumberEntity.setParcelListId(parcelListEntity.getId());
parcelNumberEntity.setQuantity(parcelListEntity.getQuantity());
parcelNumberEntity.setHandQuantity(parcelListEntity.getQuantity());
parcelNumberEntity.setDeliveryQuantity(0);
parcelNumberEntity.setSigninQuantity(0);
parcelNumberEntity.setOutboundQuantity(0);
parcelNumberEntity.setWarehouseId(parcelListEntity.getWarehouseId());
addList.add(parcelNumberEntity);
});
distributionParcelNumberService.saveBatch(addList);
}
}

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -2622,7 +2622,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
//维护订单状态
String content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "扫描签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
} else {
//这里装车的数据需要进行补录
@ -2702,7 +2702,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
packageLockIds.add(distributionLoadscanEntity.getPackageId());
String content = "包件在" + myCurrentWarehouse.getName() + "由" + distributionLoadscanEntity.getSigningUser() + "扫描签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
orderPackageCodes.add(distributionLoadscanEntity.getOrderPackageCode());
}
@ -2984,7 +2984,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:扫描装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
}
@ -3069,7 +3069,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 包件解托下架
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode();
try {
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
} catch (Exception e) {
log.error("装车日志数据错误", e);
}
@ -3407,7 +3407,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanService.updateById(distributionLoadscanEntity);
distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
} else {
@ -3481,7 +3481,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改包件装车、签收状态
packageLockIds.add(distributionLoadscanEntity.getPackageId());
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
JSONObject trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
aaa.add(trunklinePackageTrackLog);
} else {
@ -5354,7 +5354,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanService.updateById(loadscanEntities);
packageLockIds.add(loadscanEntities.getPackageId());
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode();
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd());
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd());
// distributionAsyncService.sendFactory(parcelListEntity, loadscanEntities.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
// 节点作业推送
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse);

4
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/mq/NodeDataPushListener.java

@ -111,6 +111,7 @@ public class NodeDataPushListener {
.dealerName(mtPushDataDTO.getDealerName())
.inWarehouseType(finalInWarehouseType)
.operatingTime(operatorTime)
.oms(mtPushDataDTO.getOms())
.operatingWarehouseName(warehouse)
.orderCode(pushData.getOrderCode())
.outWarehouseType(mtPushDataDTO.getOutWarehouseType())
@ -161,6 +162,7 @@ public class NodeDataPushListener {
// 按包件分组
CentralStkInConfirmVO confirmVO = CentralStkInConfirmVO.builder()
.senderCode(senderCode)
.oms(mtPushDataDTOS1.get(0).getOms())
.operatingTime(operatorTime)
.operatingWarehouseName(warehouse)
.inWarehouseType(inWarehouseType)
@ -217,6 +219,7 @@ public class NodeDataPushListener {
MtPushDataDTO mtPushDataDTO = mtPushDataDTOMap.get(pushData.getPackageCode());
if (ObjectUtil.isNotEmpty(mtPushDataDTO)) {
return SignForVO.builder()
.oms(mtPushDataDTO.getOms())
.sendTaskId(entries1.getStr("boId"))
.senderCode(mtPushDataDTO.getSenderCode())
.orderCode(pushData.getOrderCode())
@ -278,6 +281,7 @@ public class NodeDataPushListener {
.packageVOS(content.stream().map(
pushData -> {
return SignForConfirmPackageVO.builder()
.oms(mtPushDataDTOMap.get(pushData.getPackageCode()).getOms())
.orderCode(pushData.getOrderCode())
.outWarehouseType(mtPushDataDTOMap.get(pushData.getPackageCode()).getOutWarehouseType())
.packageCode(pushData.getPackageCode())

3
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/CentralStkInConfirmVO.java

@ -23,6 +23,9 @@ public class CentralStkInConfirmVO implements Serializable {
@ApiModelProperty("发货单编号")
@JsonProperty("发货单编号")
private String senderCode;
@ApiModelProperty("OMS")
@JsonProperty("OMS")
private String oms;
@ApiModelProperty("确认收货时间")
@JsonProperty("确认收货时间")

4
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/CentralStkInVO.java

@ -23,6 +23,10 @@ public class CentralStkInVO implements Serializable {
@JsonProperty("发货单编号")
private String senderCode;
@ApiModelProperty("OMS")
@JsonProperty("OMS")
private String oms;
@ApiModelProperty("订单编号")
@JsonProperty("订单编号")
private String orderCode;

4
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/SignForConfirmPackageVO.java

@ -27,6 +27,10 @@ public class SignForConfirmPackageVO implements Serializable {
@JsonProperty("订单编号")
private String orderCode;
@ApiModelProperty("OMS")
@JsonProperty("OMS")
private String oms;
@ApiModelProperty("工厂出库方式")
@JsonProperty("工厂出库方式")
private String outWarehouseType;

4
blade-service/logpm-factory-data/logpm-factory-data-mengtian/src/main/java/com/logpm/factorydata/mengtian/vo/SignForVO.java

@ -27,6 +27,10 @@ public class SignForVO implements Serializable {
@JsonProperty("发货单编号")
private String senderCode;
@ApiModelProperty("OMS")
@JsonProperty("OMS")
private String oms;
@ApiModelProperty("订单编号")
@JsonProperty("订单编号")
private String orderCode;

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java

@ -108,7 +108,8 @@ public class MtFactoryDataController extends BladeController {
@PostMapping("/data")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "通常数据推送", notes = "传入factoryOrderDTO")
public R data(@Validated @RequestBody MtFactoryDataDTO mtFactoryDataDTO, HttpServletRequest request) {
// public R data(@Validated @RequestBody MtFactoryDataDTO mtFactoryDataDTO, HttpServletRequest request) {
public R data(@Validated @RequestBody Map<String, Object> mtFactoryDataDTO, HttpServletRequest request) {
log.info("############data:{} ", mtFactoryDataDTO);
String corpId = request.getHeader("corpId");
@ -120,8 +121,10 @@ public class MtFactoryDataController extends BladeController {
orderStatusLog.setBrand("梦天");
orderStatusLogService.save(orderStatusLog);
try {
// 解析 map 为 MtFactoryDataDTO 对象
MtFactoryDataDTO dto = JSONObject.parseObject(JSONObject.toJSONString(mtFactoryDataDTO), MtFactoryDataDTO.class);
//数据存入数据库
R r = mtFactoryDataService.dealWithData(mtFactoryDataDTO);
R r = mtFactoryDataService.dealWithData(dto);
int code = r.getCode();
Map<String, Long> map = (Map<String, Long>) r.getData();

4
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/dto/MtFactoryOrderMainDTO.java

@ -24,6 +24,10 @@ public class MtFactoryOrderMainDTO implements Serializable {
@ApiModelProperty(value = "发货单编号")
private String invoiceOrderCode;
@JsonProperty("OMS")
@ApiModelProperty(value = "OMS")
private String oms;
@JsonProperty("中心仓编号")
@ApiModelProperty(value = "中心仓编号")
private String centerWarehouseCode;

1
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/mapper/MtFactoryOrderMainMapper.xml

@ -104,6 +104,7 @@
<select id="orderPushData" resultType="com.logpm.factory.mt.dto.MtPushDataDTO">
select t.order_code orderCode,pi.package_code,
m.invoice_order_code senderCode,
m.oms oms,
t.outbound_type outWarehouseType,
t.dealer_name dealerName,
m.center_warehouse_code warehouseCode

2
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/listener/mq/WaybillFanoutListener.java

@ -159,6 +159,8 @@ public class WaybillFanoutListener {
StatisticsDistributionPackageEntity statisticsDistributionPackageEntity = new StatisticsDistributionPackageEntity();
statisticsDistributionPackageEntity.setWarehouseId(warehouseId);
statisticsDistributionPackageEntity.setWarehouseName(warehouseName);
statisticsDistributionPackageEntity.setBrandId(brandId);
statisticsDistributionPackageEntity.setConsigneeId(consigneeId);
statisticsDistributionPackageEntity.setTypeService(typeService);
statisticsDistributionPackageEntity.setWaybillId(waybillId);
statisticsDistributionPackageEntity.setWaybillNo(waybillNo);

46
blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basicdata.entity.BasicdataPriceTemplateEntity;
import com.logpm.basicdata.feign.IBasicdataCodeClient;
@ -477,7 +478,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
// 模版是否有配送
if (StrUtil.contains(serviceType, "4")) {
if (CollUtil.isNotEmpty(distributionPackageEntities)) {
calculateDispatchCost(template, typeService, distributionPackageEntities, dispatch, dispatchIsMinCost);
calculateDispatchCost(template, typeService, distributionPackageEntities, dispatch, dispatchIsMinCost,brandId,consigneeId);
}
}
}
@ -519,7 +520,7 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
}
}
private void calculateDispatchCost(BasicdataPriceTemplateEntity template, String typeService, List<StatisticsDistributionPackageEntity> distributionPackageEntities, PriceDispatchVO dispatch, Integer dispatchIsMinCost) {
private void calculateDispatchCost(BasicdataPriceTemplateEntity template, String typeService, List<StatisticsDistributionPackageEntity> distributionPackageEntities, PriceDispatchVO dispatch, Integer dispatchIsMinCost, Long brandId, Long consigneeId) {
String dispatchPricingType = template.getDispatchPricingType();
// 服务类型与模版的服务类型一致
if (StrUtil.equals(dispatchPricingType, typeService)) {
@ -544,13 +545,29 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
if (ObjectUtil.equals(1, dispatchMinCostMode)) {
buildDispatchCostToPackage(dispatchMinCostType, distributionPackageEntities, minCost, additionalCost);
} else if (ObjectUtil.equals(2, dispatchMinCostMode)) {
Map<String, List<StatisticsDistributionPackageEntity>> map = distributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getTrainNumber));
if (CollUtil.isNotEmpty(map)) {
for (Map.Entry<String, List<StatisticsDistributionPackageEntity>> entry : map.entrySet()) {
List<StatisticsDistributionPackageEntity> value = entry.getValue();
buildDispatchCostToPackage(dispatchMinCostType, value, minCost, additionalCost);
// 按配送任务 计算规则 1 取出包件中所有的配送任务号 2 按配送任务号查出所有包件信息 3 按品牌和收货单位过滤(可能存在同一个配送任务存在同一客户不同订单情况) 4 按配送任务分组计算
Set<String> trainNumberSet = distributionPackageEntities.stream().map(StatisticsDistributionPackageEntity::getTrainNumber).collect(Collectors.toSet());
List<StatisticsDistributionPackageEntity> distributionPackageEntities1 = distributionPackageService.list(Wrappers.<StatisticsDistributionPackageEntity>lambdaQuery()
.in(StatisticsDistributionPackageEntity::getTrainNumber, trainNumberSet));
for (String s : trainNumberSet) {
if(CollUtil.isNotEmpty(distributionPackageEntities1)){
List<StatisticsDistributionPackageEntity> packageEntities = distributionPackageEntities1.stream()
.filter(entity -> ObjectUtil.equals(s, entity.getTrainNumber()))
.filter(entity -> ObjectUtil.equals(entity.getBrandId(), brandId))
.filter(entity -> ObjectUtil.equals(entity.getConsigneeId(), consigneeId))
.collect(Collectors.toList());
if(CollUtil.isNotEmpty(packageEntities)){
buildDispatchCostToPackage(dispatchMinCostType, packageEntities, minCost, additionalCost);
}
}
}
// Map<String, List<StatisticsDistributionPackageEntity>> map = distributionPackageEntities.stream().collect(Collectors.groupingBy(StatisticsDistributionPackageEntity::getTrainNumber));
// if (CollUtil.isNotEmpty(map)) {
// for (Map.Entry<String, List<StatisticsDistributionPackageEntity>> entry : map.entrySet()) {
// List<StatisticsDistributionPackageEntity> value = entry.getValue();
// buildDispatchCostToPackage(dispatchMinCostType, value, minCost, additionalCost);
// }
// }
}
// 保存配送包件信息
if (CollUtil.isNotEmpty(distributionPackageEntities)) {
@ -831,9 +848,10 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
int size = distributionPackageEntities.size();
// 总件数 < 最低价 则计算保底价
if (size < minCost) {
// 分摊到包件上 原单价 + 加算价格
// 分摊到包件上 原单价 + 加算价格/件数
BigDecimal divide = NumberUtil.toBigDecimal(additionalCost).divide(NumberUtil.toBigDecimal(size), 2, BigDecimal.ROUND_HALF_UP);
distributionPackageEntities.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setRealDeliveryFee(statisticsDistributionPackageEntity.getRealDeliveryFee().add(NumberUtil.toBigDecimal(additionalCost)));
statisticsDistributionPackageEntity.setRealDeliveryFee(statisticsDistributionPackageEntity.getRealDeliveryFee().add(divide));
});
}
} else if (ObjectUtil.equals(3, dispatchMinCostType)) {
@ -841,9 +859,10 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
BigDecimal totalVolume = distributionPackageEntities.stream().map(StatisticsDistributionPackageEntity::getTotalVolume).reduce(BigDecimal.ZERO, BigDecimal::add);
// 总件数 < 最低价 则计算保底价
if (NumberUtil.compare(NumberUtil.toDouble(totalVolume), minCost) < 0) {
// 分摊到包件上 原单价 + 加算价格
// 分摊到包件上 原单价 + 加算价格/件数
BigDecimal divide = NumberUtil.toBigDecimal(additionalCost).divide(NumberUtil.toBigDecimal(distributionPackageEntities.size()), 2, BigDecimal.ROUND_HALF_UP);
distributionPackageEntities.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setRealDeliveryFee(statisticsDistributionPackageEntity.getRealDeliveryFee().add(NumberUtil.toBigDecimal(additionalCost)));
statisticsDistributionPackageEntity.setRealDeliveryFee(statisticsDistributionPackageEntity.getRealDeliveryFee().add(divide));
});
}
} else if (ObjectUtil.equals(4, dispatchMinCostType)) {
@ -851,9 +870,10 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
BigDecimal totalWeight = distributionPackageEntities.stream().map(StatisticsDistributionPackageEntity::getTotalWeight).reduce(BigDecimal.ZERO, BigDecimal::add);
// 总件数 < 最低价 则计算保底价
if (NumberUtil.compare(NumberUtil.toDouble(totalWeight), minCost) < 0) {
// 分摊到包件上 原单价 + 加算价格
// 分摊到包件上 原单价 + 加算价格/件数
BigDecimal divide = NumberUtil.toBigDecimal(additionalCost).divide(NumberUtil.toBigDecimal(distributionPackageEntities.size()), 2, BigDecimal.ROUND_HALF_UP);
distributionPackageEntities.forEach(statisticsDistributionPackageEntity -> {
statisticsDistributionPackageEntity.setRealDeliveryFee(statisticsDistributionPackageEntity.getRealDeliveryFee().add(NumberUtil.toBigDecimal(additionalCost)));
statisticsDistributionPackageEntity.setRealDeliveryFee(statisticsDistributionPackageEntity.getRealDeliveryFee().add(divide));
});
}
}

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/api/TripartiteTransferApiController.java

@ -39,8 +39,8 @@ public class TripartiteTransferApiController {
Integer type = loadCarsDTO.getType();
Integer pageNum = loadCarsDTO.getPageNum();
Integer pageSize = loadCarsDTO.getPageSize();
String startDate = loadCarsDTO.getStartDate();
String endDate = loadCarsDTO.getEndDate();
String createTimeStartStr = loadCarsDTO.getCreateTimeStartStr();
String createTimeEndStr = loadCarsDTO.getCreateTimeEndStr();
try{
//当前登录人选择的仓库
@ -58,12 +58,12 @@ public class TripartiteTransferApiController {
loadCarsDTO.setPageSize(10);
}
if(StringUtil.isBlank(startDate)){
log.warn(method+"开始时间为空 startDate={}",startDate);
if(StringUtil.isBlank(createTimeStartStr)){
log.warn(method+"开始时间为空 createTimeStartStr={}",createTimeStartStr);
return R.fail(405,"开始时间为空");
}
if(StringUtil.isBlank(endDate)){
log.warn(method+"结束时间为空 endDate={}",endDate);
if(StringUtil.isBlank(createTimeEndStr)){
log.warn(method+"结束时间为空 createTimeEndStr={}",createTimeEndStr);
return R.fail(405,"结束时间为空");
}

12
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/CarsLoadController.java

@ -1801,12 +1801,12 @@ public class CarsLoadController {
try{
//当前登录人选择的仓库
// BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
// if(Objects.isNull(myCurrentWarehouse)){
// log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
// return R.fail(400,"多仓权限无法操作,请选择仓库");
// }
// loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息为空 myCurrentWarehouse={}",myCurrentWarehouse);
return R.fail(400,"多仓权限无法操作,请选择仓库");
}
loadCarsDTO.setWarehouseId(myCurrentWarehouse.getId());
if(Objects.isNull(loadId)){
log.warn(method+"配载id为空 loadId={}",loadId);

13
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/feign/TrunklineCarsLoadScanClient.java

@ -1,5 +1,7 @@
package com.logpm.trunkline.feign;
import com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity;
import com.logpm.trunkline.service.ITrunklineCarsLoadScanService;
import com.logpm.trunkline.service.ITrunklineCarsLoadService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@ -14,6 +16,7 @@ import springfox.documentation.annotations.ApiIgnore;
public class TrunklineCarsLoadScanClient implements ITrunklineCarsLoadScanClient{
private final ITrunklineCarsLoadService trunklineCarsLoadService;
private final ITrunklineCarsLoadScanService trunklineCarsLoadScanService;
@Override
@ -30,4 +33,14 @@ public class TrunklineCarsLoadScanClient implements ITrunklineCarsLoadScanClient
public R adnormalHasStock(Long carsLoadScanId, Long warehouseId) {
return trunklineCarsLoadService.adnormalHasStock(carsLoadScanId,warehouseId);
}
@Override
public TrunklineCarsLoadScanEntity findEntityById(Long associationId) {
return trunklineCarsLoadScanService.getById(associationId);
}
@Override
public void updateEntity(TrunklineCarsLoadScanEntity carsLoadScanEntity) {
trunklineCarsLoadScanService.updateById(carsLoadScanEntity);
}
}

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

@ -167,4 +167,6 @@ public interface TrunklineCarsLoadScanMapper extends BaseMapper<TrunklineCarsLoa
void addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(@Param("loadId") Long finalLoadId, @Param("nodeId") Long nodeId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo, @Param("signOrderId") Long signOrderId);
void updateFinalNodeIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId, @Param("orderCode") String orderCode, @Param("waybillNo") String waybillNo, @Param("finalNodeId") Long finalNodeId, @Param("finalNodeName") String finalNodeName);
List<TrunklineCarsLoadScanEntity> findAbnormalZeroScanList(@Param("loadId") Long loadId, @Param("warehouseId") Long warehouseId);
}

11
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml

@ -557,6 +557,7 @@
where load_id = #{loadId}
and final_node_id = #{warehouseId}
and scan_status = '1'
and type = 1
</select>
<select id="findUnloadCheckAbnormalNoDataList" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity">
@ -565,6 +566,16 @@
where load_id = #{loadId}
and unload_node_id = #{warehouseId}
and is_data = 0
and type = 1
</select>
<select id="findAbnormalZeroScanList" resultType="com.logpm.trunkline.entity.TrunklineCarsLoadScanEntity">
select *
from logpm_trunkline_cars_load_scan
where load_id = #{loadId}
and final_node_id = #{warehouseId}
and type = 2
and unload_num != num
</select>
<select id="findPackageListByLoadId" resultType="String">

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

@ -162,4 +162,6 @@ public interface ITrunklineCarsLoadScanService extends BaseService<TrunklineCars
void addSignOrderIdByLoadIdAndNodeIdAndOrderCodeAndWaybillNo(Long finalLoadId, Long nodeId, String orderCode, String waybillNo, Long signOrderId);
void updateFinalNodeIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(Long loadId, Long warehouseId, String orderCode, String waybillNo, Long finalNodeId,String finalNodeName);
List<TrunklineCarsLoadScanEntity> findAbnormalZeroScanList(Long loadId, Long warehouseId);
}

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

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.json.JSONUtil;
import com.logpm.aftersales.entity.AftersalesAbnormalRecordEntity;
@ -373,6 +374,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setAssociationId(scanId);
abnormalRecordEntity.setAssociationType(1);
abnormalRecordEntity.setRemark("无计划装车---装车记录补录");
abnormalRecordEntity.setIsZero(0);
abnormalRecordEntity.setNum(1);
abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
}
}
@ -412,6 +415,8 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setAssociationId(loadScanId);
abnormalRecordEntity.setAssociationType(1);
abnormalRecordEntity.setRemark("无装车记录 系统自动完结");
abnormalRecordEntity.setIsZero(0);
abnormalRecordEntity.setNum(1);
abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
}
}
@ -431,6 +436,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
}
List<AftersalesAbnormalRecordEntity> addList = new ArrayList<>();
List<TrunklineCarsLoadScanEntity> noUnloadList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoUnloadList(loadId,warehouseId);
for (TrunklineCarsLoadScanEntity trunklineCarsLoadScanEntity : noUnloadList) {
String loadCode = trunklineCarsLoadScanEntity.getLoadCode();
@ -444,7 +450,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setCreateUser(userId);
abnormalRecordEntity.setUpdateUser(userId);
abnormalRecordEntity.setCreateDept(deptId);
abnormalRecordEntity.setType("2");
abnormalRecordEntity.setType("1");
abnormalRecordEntity.setAbnormalType("4");
abnormalRecordEntity.setCarType("1");
abnormalRecordEntity.setWarehouseId(warehouseId);
@ -461,7 +467,10 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setAssociationId(scanId);
abnormalRecordEntity.setAssociationType(1);
abnormalRecordEntity.setRemark("无卸车记录");
abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
abnormalRecordEntity.setIsZero(0);
abnormalRecordEntity.setNum(1);
addList.add(abnormalRecordEntity);
// abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
}
List<TrunklineCarsLoadScanEntity> noDataList = trunklineCarsLoadScanService.findUnloadCheckAbnormalNoDataList(loadId,warehouseId);
@ -477,7 +486,7 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setCreateUser(userId);
abnormalRecordEntity.setUpdateUser(userId);
abnormalRecordEntity.setCreateDept(deptId);
abnormalRecordEntity.setType("2");
abnormalRecordEntity.setType("1");
abnormalRecordEntity.setAbnormalType("1");
abnormalRecordEntity.setCarType("1");
abnormalRecordEntity.setWarehouseId(warehouseId);
@ -494,8 +503,62 @@ public class CarsLoadAsyncServiceImpl implements ICarsLoadAsyncService {
abnormalRecordEntity.setAssociationId(scanId);
abnormalRecordEntity.setAssociationType(1);
abnormalRecordEntity.setRemark("无系统编码");
abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
abnormalRecordEntity.setIsZero(0);
abnormalRecordEntity.setNum(1);
addList.add(abnormalRecordEntity);
// abnormalRecordClient.addAbnormalRecord(abnormalRecordEntity);
}
List<TrunklineCarsLoadScanEntity> abnormalZeroScanList = trunklineCarsLoadScanService.findAbnormalZeroScanList(loadId,warehouseId);
if(CollUtil.isNotEmpty(abnormalZeroScanList)){
abnormalZeroScanList.forEach(carsLoadScanEntity -> {
String loadCode = carsLoadScanEntity.getLoadCode();
String waybillNo = carsLoadScanEntity.getWaybillNo();
String orderCode = carsLoadScanEntity.getOrderCode();
String scanCode = carsLoadScanEntity.getScanCode();
Long scanId = carsLoadScanEntity.getId();
Integer unloadNum = carsLoadScanEntity.getUnloadNum();
Integer num = carsLoadScanEntity.getNum();
String scanStatus = carsLoadScanEntity.getScanStatus();
Long fromWarehouseId = carsLoadScanEntity.getFromWarehouseId();
//卸车数量异常
AftersalesAbnormalRecordEntity abnormalRecordEntity = new AftersalesAbnormalRecordEntity();
abnormalRecordEntity.setTenantId(tenantId);
abnormalRecordEntity.setCreateUser(userId);
abnormalRecordEntity.setUpdateUser(userId);
abnormalRecordEntity.setCreateDept(deptId);
abnormalRecordEntity.setType("1");
abnormalRecordEntity.setAbnormalType("5");
abnormalRecordEntity.setCarType("1");
abnormalRecordEntity.setWarehouseId(warehouseId);
abnormalRecordEntity.setWarehouseName(warehouseName);
abnormalRecordEntity.setCarsNo(loadCode);
abnormalRecordEntity.setWaybillNo(waybillNo);
abnormalRecordEntity.setOrderCode(orderCode);
abnormalRecordEntity.setOrderPackageCode(scanCode);
abnormalRecordEntity.setUpUserId(userId);
abnormalRecordEntity.setUpUserName(nickName);
abnormalRecordEntity.setAbnormalStatus(0);
abnormalRecordEntity.setRemark("零担卸车数量异常");
if("3".equals(scanStatus)){
abnormalRecordEntity.setAbnormalStatus(1);
abnormalRecordEntity.setRemark("零担签收未完成数量回退原仓");
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, fromWarehouseId);
if(!Objects.isNull(stockArticleEntity)){
distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(),num-unloadNum);
}
}
abnormalRecordEntity.setSendOrderStatus(0);
abnormalRecordEntity.setUpTime(new Date());
abnormalRecordEntity.setAssociationId(scanId);
abnormalRecordEntity.setAssociationType(1);
abnormalRecordEntity.setIsZero(1);
abnormalRecordEntity.setNum(num-unloadNum);
addList.add(abnormalRecordEntity);
});
}
abnormalRecordClient.addAbnormalRecordList(addList);
}
@LogpmAsync("asyncExecutor")

10
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java

@ -427,7 +427,17 @@ public class InComingServiceImpl implements IInComingService {
} catch (Exception e) {
log.error(">>>>>>>>>>>>>>>>>>>>>>>>>> 预入库消息推送失败~ 请联系管理员! ", e);
}
List<TrunklineAdvanceDetailEntity> updateAdvanceDetailList = new ArrayList<>();
advanceDetailEntities.forEach(advanceDetailEntity -> {
TrunklineAdvanceDetailEntity updateDetailEntity = new TrunklineAdvanceDetailEntity();
updateDetailEntity.setPackageStatus("1");
updateDetailEntity.setIncomingTime(new Date());
updateDetailEntity.setIncomingWarehouseId(warehouseId);
updateDetailEntity.setIncomingWarehouseName(finalWarehouseName);
updateAdvanceDetailList.add(updateDetailEntity);
});
advanceDetailService.updateBatchById(updateAdvanceDetailList);
} else if ("1".equals(packageStatus)) {
//已入库包件

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

@ -393,4 +393,9 @@ public class TrunklineCarsLoadScanServiceImpl extends BaseServiceImpl<TrunklineC
baseMapper.updateFinalNodeIdByLoadIdAndWarehouseIdAndOrderCodeAndWaybillNo(loadId,warehouseId,orderCode,waybillNo,finalNodeId,finalNodeName);
}
@Override
public List<TrunklineCarsLoadScanEntity> findAbnormalZeroScanList(Long loadId, Long warehouseId) {
return baseMapper.findAbnormalZeroScanList(loadId,warehouseId);
}
}

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

@ -1166,7 +1166,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
parcelNumberEntity.setStockArticleId(orderId);
parcelNumberEntity.setParcelListId(orderPackageId);
parcelNumberEntity.setQuantity(newParcelListEntity.getQuantity());
parcelNumberEntity.setHandQuantity(0);
parcelNumberEntity.setHandQuantity(newParcelListEntity.getQuantity());
parcelNumberEntity.setDeliveryQuantity(0);
parcelNumberEntity.setSigninQuantity(0);
parcelNumberEntity.setOutboundQuantity(0);

15
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineWaybillPackageServiceImpl.java

@ -1,5 +1,6 @@
package com.logpm.trunkline.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -170,12 +171,14 @@ public class TrunklineWaybillPackageServiceImpl extends BaseServiceImpl<Trunklin
BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId);
if(!Objects.isNull(warehouseEntity)){
//更新所有包件的当前所在仓
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = advanceDetailService.findListByOrderPackageCodeList(orderPackageCodes);
advanceDetailEntities.forEach(advanceDetailEntity -> {
advanceDetailEntity.setNowWarehouseId(warehouseId);
advanceDetailEntity.setNowWarehouseName(warehouseEntity.getName());
});
advanceDetailService.updateBatchById(advanceDetailEntities);
if(CollUtil.isNotEmpty(orderPackageCodes)){
List<TrunklineAdvanceDetailEntity> advanceDetailEntities = advanceDetailService.findListByOrderPackageCodeList(orderPackageCodes);
advanceDetailEntities.forEach(advanceDetailEntity -> {
advanceDetailEntity.setNowWarehouseId(warehouseId);
advanceDetailEntity.setNowWarehouseName(warehouseEntity.getName());
});
advanceDetailService.updateBatchById(advanceDetailEntities);
}
}

176
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -19,6 +19,7 @@ package com.logpm.warehouse.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@ -58,16 +59,22 @@ import com.logpm.warehouse.service.IWarehouseWarehousingEntryService;
import com.logpm.warehouse.vo.WarehouseWarehousingEntryVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.DictBiz;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IDictBizClient;
import org.springblade.system.feign.IUserClient;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -101,6 +108,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
private final IWarehouseUpdownTypeService warehouseUpdownTypeService;
private final IWarehouseTrayTypeService warehouseTrayTypeService;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
private final IUserClient userClient;
@Override
@ -209,10 +217,10 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detailEntity.setId(i.getId());
detailEntity.setActualReceipt(next.getActualReceipt()); //实际
int i2 = next.getCreateInventory() - i.getCreateInventory();
if ( next.getCreateInventory() < i.getActualReceipt()){
if (next.getCreateInventory() < i.getActualReceipt()) {
//入库单预计数量无法进行减少
log.info("入库单进行预计数量修改,原计划录入:{},目标修改:{}",i.getCreateInventory(),next.getCreateInventory());
log.info("入库单进行预计数量修改,已入库数量:{}",i.getActualReceipt());
log.info("入库单进行预计数量修改,原计划录入:{},目标修改:{}", i.getCreateInventory(), next.getCreateInventory());
log.info("入库单进行预计数量修改,已入库数量:{}", i.getActualReceipt());
throw new RuntimeException("入库单预计数量不能小于已入库数量");
}
detailEntity.setCreateInventory(next.getCreateInventory());
@ -227,8 +235,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.updateById(detailEntity);//修改数据
//当前入库数量
int i1 = next.getActualReceipt() - i.getActualReceipt();
if (i1< 0){
log.info("入库单进行预计数量修改,已入库数量:{},目标修改数量:{}",i.getActualReceipt(),next.getActualReceipt());
if (i1 < 0) {
log.info("入库单进行预计数量修改,已入库数量:{},目标修改数量:{}", i.getActualReceipt(), next.getActualReceipt());
throw new RuntimeException("请输入正确的入库数量");
}
//添加库存品
@ -380,10 +388,10 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
Integer loadingType = warehousingDetail.getLoadingType();
if (Func.isNotEmpty(loadingType)){
log.info(">>>>>>>>>>>>>>>>>>>>>>入库单录入》》》》》》》》》》loadingType:{}",warehousingDetail.getLoadingType());
log.info(">>>>>>>>>>>>>>>>>>>>>>入库单录入》》》》》》》》》》allocationId:{}",warehousingDetail.getAllocationId());
if (loadingType.equals(1)){
if (Func.isNotEmpty(loadingType)) {
log.info(">>>>>>>>>>>>>>>>>>>>>>入库单录入》》》》》》》》》》loadingType:{}", warehousingDetail.getLoadingType());
log.info(">>>>>>>>>>>>>>>>>>>>>>入库单录入》》》》》》》》》》allocationId:{}", warehousingDetail.getAllocationId());
if (loadingType.equals(1)) {
//上架至库位
List<UpShelfStockDTO> list = new ArrayList<>();
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO();
@ -395,8 +403,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
upShelfStockDTO.setEnterNum(num);
upShelfStockDTO.setWarehouseId(entity.getWarehouseId());
list.add(upShelfStockDTO);
warehouseUpdownTypeService.upShelfStockList(list,warehousingDetail.getAllocationId(),entity.getWarehouseId(),"入库单录入数量上架至"+warehousingDetail.getAllocationName()+num+"件");
}else {
warehouseUpdownTypeService.upShelfStockList(list, warehousingDetail.getAllocationId(), entity.getWarehouseId(), "入库单录入数量上架至" + warehousingDetail.getAllocationName() + num + "件");
} else {
//进行打托操作
BasicdataTrayEntity basicdataTray = basicdataTrayClient.findByTrayName(warehousingDetail.getTrayName());
@ -408,7 +416,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
noDataStockListDTO.setNum(num);
noDataStockListDTOS.add(noDataStockListDTO);
warehouseTrayTypeService.enterStockNoDataMaterialCode(basicdataTray.getPalletCode(),"100",noDataStockListDTOS,entity.getWarehouseId(),"入库单录入数量,打托至"+warehousingDetail.getTrayName()+num+"件");
warehouseTrayTypeService.enterStockNoDataMaterialCode(basicdataTray.getPalletCode(), "100", noDataStockListDTOS, entity.getWarehouseId(), "入库单录入数量,打托至" + warehousingDetail.getTrayName() + num + "件");
}
}
@ -419,7 +427,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
BeanUtil.copyProperties(entity, distributionStockListInfo);
distributionStockListInfo.setSourceType("2");//导入
distributionStockListInfo.setQuantityStock(num);
distributionStockListInfo.setStorageLocation(warehousingDetail.getAllocationName() == null|| Func.isEmpty(warehousingDetail.getAllocationName())?warehousingDetail.getTrayName():warehousingDetail.getAllocationName());
distributionStockListInfo.setStorageLocation(warehousingDetail.getAllocationName() == null || Func.isEmpty(warehousingDetail.getAllocationName()) ? warehousingDetail.getTrayName() : warehousingDetail.getAllocationName());
distributionStockListInfo.setId(null);
return distributionStockListInfoClient.addStockListInfoEntity(distributionStockListInfo);
}
@ -549,27 +557,27 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detail.setCreateInventory(i.getCreateInventory());
detail.setWarehousingEntryId(entryEntity.getId());
detail.setActualReceipt(0);
if (!ObjectUtils.isNull(i.getPositions()) && Func.isNotEmpty(i.getLoadingType())){
if (!ObjectUtils.isNull(i.getPositions()) && Func.isNotEmpty(i.getLoadingType())) {
String positions = i.getPositions();
positions =positions.trim().replaceAll("\n","").replaceAll("\r","");
positions = positions.trim().replaceAll("\n", "").replaceAll("\r", "");
//查询库位
if (i.getLoadingType().equals("1")){
//库位
WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity = warehouseGoodsAllocationClient.findByAllocationQrCode(positions);
if (Func.isNotEmpty(warehouseGoodsAllocationEntity)){
detail.setLoadingType(1);
detail.setAllocationId(warehouseGoodsAllocationEntity.getId());
detail.setAllocationName(warehouseGoodsAllocationEntity.getQrCode());
}
}else {
//托盘
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.findByTrayName(positions);
if (Func.isNotEmpty(basicdataTrayEntity)){
detail.setLoadingType(2);
detail.setTrayId(basicdataTrayEntity.getId());
detail.setTrayName(basicdataTrayEntity.getPalletName());
}
if (i.getLoadingType().equals("1")) {
//库位
WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity = warehouseGoodsAllocationClient.findByAllocationQrCode(positions);
if (Func.isNotEmpty(warehouseGoodsAllocationEntity)) {
detail.setLoadingType(1);
detail.setAllocationId(warehouseGoodsAllocationEntity.getId());
detail.setAllocationName(warehouseGoodsAllocationEntity.getQrCode());
}
} else {
//托盘
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.findByTrayName(positions);
if (Func.isNotEmpty(basicdataTrayEntity)) {
detail.setLoadingType(2);
detail.setTrayId(basicdataTrayEntity.getId());
detail.setTrayName(basicdataTrayEntity.getPalletName());
}
}
}
//品牌
BasicdataStoreBrandEntity brandList = basicdataStoreBrandClient.getBrandList(entryEntity.getClientId(), i.getBrandName());
@ -642,13 +650,111 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
@Override
public List<PrintPreviewVO> printBatch(String ids, Integer type) {
BasicPrintTemplateEntity printTemplate = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.stock_import_1.getValue());
if (ObjectUtils.isNull(printTemplate)){
throw new ServiceException("打印模板不存在!");
try {
List<PrintPreviewVO> printPreviewVOList = new ArrayList<>();
BasicPrintTemplateEntity printTemplate = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.stock_import_1.getValue());
String html = TemplateUtil.getTemplateByUrl(printTemplate.getTemplateUrl());
if (ObjectUtils.isNull(printTemplate)) {
throw new ServiceException("打印模板不存在!");
}
String[] idsArr = ids.split(",");
List<WarehouseWarehousingEntryEntity> list = baseMapper.selectBatchIds(Arrays.asList(idsArr));
// 根据入库ID查询 库存品详情
LambdaQueryWrapper<WarehouseWarehousingDetailEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(WarehouseWarehousingDetailEntity::getWarehousingEntryId, Arrays.asList(idsArr));
queryWrapper.eq(WarehouseWarehousingDetailEntity::getIsDeleted, "0");
List<WarehouseWarehousingDetailEntity> detailList = warehouseWarehousingDetailService.list(queryWrapper);
// 按照入库ID分组
Map<Long, List<WarehouseWarehousingDetailEntity>> detailMap = detailList.stream().collect(Collectors.groupingBy(WarehouseWarehousingDetailEntity::getWarehousingEntryId));
if (Func.isNotEmpty(list)) {
for (WarehouseWarehousingEntryEntity warehouseWarehousingEntryEntity : list) {
// 查询子表明细
List<WarehouseWarehousingDetailEntity> warehouseWarehousingDetailEntities = detailMap.get(warehouseWarehousingEntryEntity.getId());
PrintPreviewVO printPreviewVO = buildPrintPreviewVO(warehouseWarehousingEntryEntity, warehouseWarehousingDetailEntities, printTemplate, html);
printPreviewVOList.add(printPreviewVO);
}
}
return printPreviewVOList;
} catch (Exception e) {
log.error("打印入库单异常", e);
throw new ServiceException("服务器异常,请联系管理员");
}
}
/**
* 构建入库单信息
*
* @param warehouseWarehousingEntryEntity
* @param warehouseWarehousingDetailEntities
* @param printTemplate
* @return
*/
private PrintPreviewVO buildPrintPreviewVO(WarehouseWarehousingEntryEntity warehouseWarehousingEntryEntity, List<WarehouseWarehousingDetailEntity> warehouseWarehousingDetailEntities, BasicPrintTemplateEntity printTemplate, String html) throws Exception {
Map<String, Object> map = new HashMap<>();
map.put("入库时间", DateUtil.DATE_FORMAT.format(warehouseWarehousingEntryEntity.getReceiptDate()));
map.put("入库批次", warehouseWarehousingEntryEntity.getReceiptBatch());
map.put("客户名称", warehouseWarehousingEntryEntity.getCustomerName());
map.put("客户编码", warehouseWarehousingEntryEntity.getCustomerCode());
map.put("门店名称", warehouseWarehousingEntryEntity.getStoreName());
map.put("物流公司", warehouseWarehousingEntryEntity.getLogisticsCompany());
map.put("物流运单号", warehouseWarehousingEntryEntity.getTrainNumber());
map.put("入库车牌", warehouseWarehousingEntryEntity.getLicensePlate());
map.put("订单号", warehouseWarehousingEntryEntity.getOrderNumber());
map.put("所在仓库", warehouseWarehousingEntryEntity.getWarehouse());
map.put("服务类型", DistributionTypeConstant.getName(warehouseWarehousingEntryEntity.getServiceType()));
map.put("备注", warehouseWarehousingEntryEntity.getRemark());
R<User> userR = userClient.userInfoById(warehouseWarehousingEntryEntity.getCreateUser());
if (userR.isSuccess() && userR.getData() != null) {
map.put("制单人", userR.getData().getName());
}
map.put("制单时间", DateUtil.DATETIME_FORMAT.format(warehouseWarehousingEntryEntity.getCreateTime()));
return null;
List<Map<String, Object>> dataList = new ArrayList<>();
for (WarehouseWarehousingDetailEntity warehouseWarehousingDetailEntity : warehouseWarehousingDetailEntities) {
Map<String, Object> dataMap = buildDataMap(warehouseWarehousingDetailEntity);
dataList.add(dataMap);
}
map.put("入库明细", dataList);
String popHtml = TemplateUtil.popTemplate("入库单打印", map, html);
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
printPreviewVO.setTemplateId(printTemplate.getId());
printPreviewVO.setTemplateHtml(popHtml);
return printPreviewVO;
}
@NotNull
private static Map<String, Object> buildDataMap(WarehouseWarehousingDetailEntity warehouseWarehousingDetailEntity) {
Map<String, Object> dataMap = new HashMap<>();
dataMap.put("SKU", warehouseWarehousingDetailEntity.getSku());
dataMap.put("物料编码", warehouseWarehousingDetailEntity.getProductCode());
dataMap.put("物科名称", warehouseWarehousingDetailEntity.getProductName());
dataMap.put("物料单位", warehouseWarehousingDetailEntity.getProductUnit());
dataMap.put("包装数据", warehouseWarehousingDetailEntity.getPackagingNumber());
dataMap.put("品牌", warehouseWarehousingDetailEntity.getBrandName());
dataMap.put("托盘名称", warehouseWarehousingDetailEntity.getTrayName());
dataMap.put("预计入库件数", warehouseWarehousingDetailEntity.getCreateInventory());
dataMap.put("实际入库件数", warehouseWarehousingDetailEntity.getActualReceipt());
return dataMap;
}
}

Loading…
Cancel
Save