Browse Source

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

# Conflicts:
#	blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java
single_db
汤建军 1 year ago
parent
commit
9bc06b3ad7
  1. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java
  2. 56
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java
  3. 9
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java
  4. 41
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionParcelListVO.java
  5. 2
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayClient.java
  6. 8
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java
  7. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java
  8. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.java
  10. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.xml
  11. 42
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  12. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSigndetailMapper.xml
  13. 29
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderPackageStatusDataHandler.java
  14. 41
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  15. 370
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionParcelListServiceImpl.java
  16. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionParcelListWrapper.java
  17. 17
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  18. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayClient.java
  19. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.java
  20. 6
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.xml
  21. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayService.java
  22. 5
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayServiceImpl.java
  23. 42
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java
  24. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayInfoDTO.java
  25. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IAsyncDataService.java
  26. 38
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java

@ -69,5 +69,6 @@ public interface IBasicdataTrayClient {
@GetMapping(GETTRAYENTITYLIST)
List<BasicdataTrayEntity> getTrayEntityList();
@GetMapping(API_PREFIX+"/getTrayByTrayNo")
BasicdataTrayEntity getTrayByTrayNo(@RequestParam String trayNo);
}

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

@ -70,6 +70,62 @@ public class DistributionParcelListEntity extends TenantEntity {
*/
@ApiModelProperty(value = "订单自编号")
private String orderCode;
/**
* 预约号
*/
@ApiModelProperty(value = "预约号")
@TableField(exist = false)
private String reservationCode;
/**
* 装车时间
*/
@ApiModelProperty(value = "装车时间")
@TableField(exist = false)
private Date scanTimes;
/**
* 签收时间
*/
@ApiModelProperty(value = "签收时间")
@TableField(exist = false)
private Date signingTimes;
/**
* 配送车次
*/
@ApiModelProperty(value = "配送车次")
@TableField(exist = false)
private String dvehicleName;
/**
* 实际装车人
*/
@ApiModelProperty(value = "签收人")
@TableField(exist = false)
private String signingUser;
/**
* 装车人
*/
@ApiModelProperty(value = "装车人")
@TableField(exist = false)
private String scanUser;
/**
*签收车次
*/
@ApiModelProperty(value = "签收车次")
@TableField(exist = false)
private String zvehicleName;
/**
*配送司机
*/
@ApiModelProperty(value = "配送司机")
@TableField(exist = false)
private String driverName;
/**
*配送单号
*/
@ApiModelProperty(value = "配送单号")
@TableField(exist = false)
private String noteNumber;
/**
* 仓库
*/

9
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionDeliveryInfoVO.java

@ -335,6 +335,15 @@ public class DistributionDeliveryInfoVO extends DistributionDeliveryInfoEntity {
*/
@ApiModelProperty(value = "指派状态")
private String assignStatusName;
/**
* 签收人员
*/
private String signingUser;
/**
* 签收时间
*/
private String signingTime;
// /**
// * 配送方式
// */

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

@ -16,7 +16,9 @@
*/
package com.logpm.distribution.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -126,10 +128,43 @@ public class DistributionParcelListVO extends DistributionParcelListEntity {
* 签收数量
*/
private Date loadingTime;
/**
* 实际装车人
*/
@ApiModelProperty(value = "签收人")
@TableField(exist = false)
private String signingUser;
/**
* 预约号
*/
@ApiModelProperty(value = "预约号")
@TableField(exist = false)
private String reservationCode;
/**
* 装车时间
*/
@ApiModelProperty(value = "装车时间")
@TableField(exist = false)
private String scanTime;
/**
* 配送车次
*/
@ApiModelProperty(value = "配送车次")
@TableField(exist = false)
private String dvehicleName;
/**
*签收车次
*/
@ApiModelProperty(value = "签收车次")
@TableField(exist = false)
private String zvehicleName;
/**
*配送单号
*/
@ApiModelProperty(value = "配送单号")
@TableField(exist = false)
private String noteNumber;
}

2
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/ITrayClient.java

@ -43,6 +43,8 @@ public interface ITrayClient {
@GetMapping(API_PREFIX+"/getTrayById")
TrayEntity getTrayById(@RequestParam Integer trayId);
@GetMapping(API_PREFIX+"/getTrayByTrayNo")
TrayEntity getTrayByTrayNo(@RequestParam String trayNo);
// @GetMapping(API_PREFIX + "/getOrderByOrderSelfNum")

8
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java

@ -101,4 +101,12 @@ public class BasicdataTrayClient implements IBasicdataTrayClient {
return basicdataTrayService.list();
}
@Override
public BasicdataTrayEntity getTrayByTrayNo(String trayNo) {
QueryWrapper<BasicdataTrayEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("pallet_name",trayNo)
.eq("is_deleted",0);
return basicdataTrayService.getOne(queryWrapper);
}
}

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.java

@ -141,4 +141,11 @@ public interface DistributionLoadscanMapper extends BaseMapper<DistributionLoads
* @return
*/
Integer selectAbnormalSigningByReservationId(@Param("reservationId")Long reservationId);
/**
* 统计装车数据
* @param deliveryId
* @return
*/
Integer getLoadCountNum(@Param("deliveryId") Long deliveryId);
}

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml

@ -255,4 +255,21 @@
SELECT COUNT(received_quantity) FROM logpm_distribution_loadscan WHERE is_abnormal_signing = 2 AND signfor_state = 2 AND reservation_id = #{reservationId}
</select>
<select id="getLoadCountNum" resultType="int">
SELECT
count( ldl.id )
FROM
logpm_distribution_loadscan ldl
right JOIN logpm_distribution_reservation ldr on ldr.id= ldl.reservation_id and ldr.reservation_status !='40'
WHERE
ldl.is_deleted = 0
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != '1'
AND ldl.is_abnormal_loading = 1
</select>
</mapper>

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

@ -58,4 +58,6 @@ public interface DistributionLoadscaninvnMapper extends BaseMapper<DistributionL
* @return
*/
Integer statisticsLoadingNum(@Param("deliveryListId") Long deliveryId);
Integer getLoadCountNum(@Param("deliveryId") Long deliveryId);
}

11
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscaninvnMapper.xml

@ -71,5 +71,16 @@
<select id="statisticsLoadingNum" resultType="java.lang.Integer">
SELECT COUNT(ldl.loaded_nub) FROM logpm_distribution_loadscaninvn AS ldl WHERE delivery_id = #{deliveryListId}
</select>
<select id="getLoadCountNum" resultType="int">
SELECT
count( ldl.id )
FROM
logpm_distribution_loadscaninvn ldl
right JOIN logpm_distribution_reservation ldr on ldr.id= ldl.reservation_id and ldr.reservation_status !='40'
WHERE
ldl.is_deleted = 0
AND ldl.delivery_id = #{deliveryId}
AND ldl.scan_status != '1'
</select>
</mapper>

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

@ -134,17 +134,51 @@
ldpl.warehouse_entry_time_end warehouseEntryTimeEnd,
ldpl.waybill_number waybillNumber,
lwug.position_code goodsAllocation,
lwtg.tray_code pallet
lwtg.tray_code pallet,
ldr.reservation_code reservationCode,
ldl.scan_time scanTimes,
lddl.vehicle_name dvehicleName,
ldl.vehicle_name zvehicleName,
lddl.driver_name driverName,
lddl.note_number noteNumber,
ldl.signing_time signingTimes,
ldl.signing_user signingUser,
ldl.scan_user scanUser
FROM
logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id
LEFT JOIN logpm_warehouse_tray_goods lwtg ON ldpl.id = lwtg.association_id
left join logpm_warehouse_warehouse lww on lww.id = ldpl.warehouse_id
LEFT JOIN logpm_distribution_reservation_package ldrp on ldrp.parce_list_id = ldpl.id and ldrp.packet_bar_status = '1'
LEFT JOIN logpm_distribution_reservation ldr on ldr.id = ldrp.reservation_id
LEFT JOIN logpm_distribution_loadscan ldl on ldl.package_id = ldpl.id and ldl.type = 2
LEFT JOIN logpm_distribution_delivery_list lddl on lddl.id = ldl.delivery_id
<where>
ldpl.is_deleted = 0
<if test="param.warehouse !='' and param.warehouse != null">
and lww.name like concat('%',#{param.warehouse},'%')
</if>
<if test="param.reservationCode !='' and param.reservationCode != null">
and ldr.reservation_code = #{param.reservationCode}
</if>
<if test="param.DvehicleName !='' and param.DvehicleName != null">
and lddl.vehicle_name = #{param.DvehicleName}
</if>
<if test="param.ZvehicleName !='' and param.ZvehicleName != null">
and ldl.vehicle_name = #{param.ZvehicleName}
</if>
<if test="param.scanTime !='' and param.scanTime != null">
and date_format(from_unixtime(ldl.scan_time),'%Y-%m-%d') = date_format(#{param.scanTime}),'%Y-%m-%d')
</if>
<if test="param.signingTime !='' and param.signingTime != null">
and date_format(from_unixtime(lddl.signing_time),'%Y-%m-%d') = date_format(#{param.signingTime}),'%Y-%m-%d')
</if>
<if test="param.driverName !='' and param.driverName != null">
and lddl.driver_name = #{param.driverName}
</if>
<if test="param.noteNumber !='' and param.noteNumber != null">
and lddl.note_number = #{param.noteNumber}
</if>
<if test="param.orderPackageGroundingStatus !='' and param.orderPackageGroundingStatus != null">
and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}
@ -192,6 +226,12 @@
<if test="param.orderPackageFreezeStatus !='' and param.orderPackageFreezeStatus != null">
and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus}
</if>
<if test="param.orderPackageLoadingStatus !='' and param.orderPackageLoadingStatus != null">
and ldpl.order_package_loading_status = #{param.orderPackageLoadingStatus}
</if>
<if test="param.orderPackageReservationStatus !='' and param.orderPackageReservationStatus != null">
and ldpl.order_package_reservation_status = #{param.orderPackageReservationStatus}
</if>
<if test="param.pallet !='' and param.pallet != null">
and lwtg.tray_code = #{param.pallet}
</if>

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

@ -359,10 +359,12 @@
ldpl.firsts firsts,
ldpl.SECOND SECOND,
ldpl.third_product thirdProduct,
(select COALESCE (ldl.received_quantity ,0) from logpm_distribution_loadscan ldl WHERE ldl.package_id =ldpl.id) receivedQuantity
(select COALESCE (ldl.received_quantity ,0) from logpm_distribution_loadscan ldl WHERE ldl.package_id =ldpl.id and ldl.signfor_state = 2 ) receivedQuantity,
ldl.signing_user signingUser, ldl.signing_time signingTime
FROM
logpm_distribution_reservation_package ldrp
JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldrp.parce_list_id
LEFT JOIN logpm_distribution_loadscan ldl on ldl.package_id = ldpl.id
<where>
ldrp.stock_article_id = #{param.id}
</where>

29
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/OrderPackageStatusDataHandler.java

@ -50,35 +50,6 @@ public class OrderPackageStatusDataHandler {
// 更新状态
baseMapper.updateOrderPackageCodeById(parcelListEntity.getId(),groundingStatus);
// log.info(">>>> 更新包间状态 >> 包件ID {} 状态 {}",parcelListEntity.getId(),groundingStatus);
// String orderCode = parcelListEntity.getOrderCode();
//
// QueryWrapper<DistributionStockArticleEntity> stockArticleEntityQueryWrapper = new QueryWrapper<>();
// stockArticleEntityQueryWrapper.eq("order_code",orderCode)
// .eq("is_deleted",0);
// DistributionStockArticleEntity one = distributionStockArticleMapper.selectOne(stockArticleEntityQueryWrapper);
// Integer totalNumber = one.getTotalNumber();
//
// QueryWrapper<DistributionParcelListEntity> queryWrapperList = new QueryWrapper<>();
// queryWrapperList.eq("order_code",orderCode)
// .eq("order_package_grounding_status","20")
// .eq("warehouse_id",warehouseId)
// .eq("is_deleted",0);
// List<DistributionParcelListEntity> listEntityList = baseMapper.selectList(queryWrapperList);
// int size = listEntityList.size();
// if(size == 0){
// //更新订单上架状态
// baseMapper.updateOrderGroundingStatus(orderCode,"10",warehouseId);
// }else if(size >= totalNumber){
// //更新订单上架状态
// baseMapper.updateOrderGroundingStatus(orderCode,"30",warehouseId);
// }else{
// //更新订单上架状态
// baseMapper.updateOrderGroundingStatus(orderCode,"20",warehouseId);
// }
}catch (Exception e){
// 更新状态报错

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

@ -921,34 +921,24 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// }
@NotNull
private String getLoadingMsg(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()).eq(DistributionLoadscanEntity::getIsAbnormalLoading,1));
List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()).ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
private Integer getCarLaodNum(Long deliveryId){
AtomicInteger loadingNum = new AtomicInteger();
// AtomicInteger abnormalLoadingNum = new AtomicInteger();
if (Func.isNotEmpty(distributionLoadscanEntitiesflag)) {
//统计装车包件
// Long yijingLoadingNum = distributionLoadscanEntitiesflag.stream().count();
int yijingLoadingNum = distributionLoadscanEntitiesflag.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
Integer contNum_a = distributionLoadscanMapper.getLoadCountNum(deliveryId);
loadingNum.getAndAdd(contNum_a);
loadingNum.getAndAdd(yijingLoadingNum);
// int yichangLoadingNum = distributionLoadscanEntitiesflag.stream().filter(f -> Func.equals(f.getIsAbnormalLoading(), 2)).mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
// if (yichangLoadingNum > 0) {
// abnormalLoadingNum.getAndAdd(yichangLoadingNum);
// }
}
Integer contNum_b= distributionLoadscaninvnMapper.getLoadCountNum(deliveryId);
loadingNum.getAndAdd(contNum_b);
return loadingNum.get();
}
@NotNull
private String getLoadingMsg(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
if (Func.isNotEmpty(distributionLoadscaninvnEntities)) {
//统计库存品装车数量
int inventoryLoadingNum = distributionLoadscaninvnEntities.stream().mapToInt(DistributionLoadscaninvnEntity::getLoadedNub).sum();
loadingNum.getAndAdd(inventoryLoadingNum);
}
StringBuilder str = new StringBuilder();
str.append("装车").append(loadingNum.get() + "件");
// if (abnormalLoadingNum.get() > 0) {
// str.append("异常").append(abnormalLoadingNum.get() + "件");
// }
str.append("装车").append(getCarLaodNum(distrilbutionloadingscanDTO.getDeliveryId()) + "件");
return str.toString();
}
@ -2375,6 +2365,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
//转换字典字段
for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) {
distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId()));
// 调用下 查询装车件数的方法
//查询备货区
if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) {
List<String> list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId());

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

@ -44,6 +44,7 @@ import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException;
@ -93,8 +94,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private final IDistrilbutionBillPackageService distrilbutionBillPackageService;
private final IBasicdataWarehouseClient warehouseClient;
private final RabbitTemplate rabbitTemplate;
private final RabbitTemplate rabbitTemplate;
@Override
@ -110,7 +110,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Override
public boolean submitNumByOrderIdAndName(Long articleId, String productName, Integer num) {
int i = baseMapper.submitNumByOrderIdAndName(articleId,productName,num);
int i = baseMapper.submitNumByOrderIdAndName(articleId, productName, num);
// if(i == 1){
// return true;
// }else{
@ -136,6 +136,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/**
* 查询备货包件信息
*
* @param page
* @param distributionParcelList
* @return
@ -144,9 +145,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
public IPage<DistributionParcelListVO> getParcelListOwn(IPage<Object> page, Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("id");
IPage<DistributionParcelListVO> parcelListOwn = baseMapper.getParcelListOwn(page, Long.parseLong((String) o));
parcelListOwn.getRecords().forEach(i ->{
if(ObjectUtils.isNotNull(i) && ObjectUtils.isNotNull(i.getStockupStatus())){
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STOCKUP_STATUS,i.getStockupStatus()));
parcelListOwn.getRecords().forEach(i -> {
if (ObjectUtils.isNotNull(i) && ObjectUtils.isNotNull(i.getStockupStatus())) {
i.setStockupStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STOCKUP_STATUS, i.getStockupStatus()));
}
//出现货位信息
String s = warehouseUpdownGoodsClient.selectMsgBywrap(i.getId());
@ -159,10 +160,10 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
public IPage<DistributionParcelListVO> getParcelListOwnSelf(IPage<Object> page, Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("id");
IPage<DistributionParcelListVO> parcelListOwn = baseMapper.getParcelListOwnSelf(page, Long.parseLong((String) o));
parcelListOwn.getRecords().forEach(i ->{
if(ObjectUtils.isNotNull( i.getStockupStatus())){
parcelListOwn.getRecords().forEach(i -> {
if (ObjectUtils.isNotNull(i.getStockupStatus())) {
i.setStockupStatusName(OrderStockupStatusConstant.yibeihu.getName());
}else{
} else {
i.setStockupStatusName(OrderStockupStatusConstant.daibeihuo.getName());
}
@ -178,30 +179,29 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
// 上架状态
}
@Override
public void updateGroundingStatus(String orderPackageCode, String groundingStatus,Long warehouseId) {
try{
updateGroundingStatus(orderPackageCode,groundingStatus,warehouseId);
}catch (Exception e){
log.error("###############updateGroundingStatus: 更新上架状态失败 orderPackageCode={} warehouseId={} groundingStatus={}",orderPackageCode,warehouseId,groundingStatus);
public void updateGroundingStatus(String orderPackageCode, String groundingStatus, Long warehouseId) {
try {
// baseMapper.updateGroundingStatus(orderPackageCode,groundingStatus,warehouseId);
log.info(">>>>> 发送消息给MQ start 包件{}", orderPackageCode);
Map<String, Object> map = new HashMap();
map.put("messageId", CommonUtil.getUUID());
map.put("orderPackageCode", orderPackageCode);
map.put("groundingStatus", groundingStatus);
map.put("warehouseId", warehouseId);
rabbitTemplate.convertAndSend(RabbitConstant.ORDER_PACKAGE_STATUS_INFO_EXCHANGE, RabbitConstant.ORDER_PACKAGE_STATUS_INFO_ROUTING, map);
log.info(">>>>> 发送消息给MQ end 包件{}", orderPackageCode);
} catch (Exception e) {
log.error(">>>>>>> errr",e);
log.error("###############updateGroundingStatus: 更新上架状态失败 orderPackageCode={} warehouseId={} groundingStatus={}", orderPackageCode, warehouseId, groundingStatus);
}
// log.info(">>>>> 发送消息给MQ start 包件{}",orderPackageCode);
//
// Map<String,Object> map = new HashMap();
// map.put("messageId", CommonUtil.getUUID());
// map.put("orderPackageCode", orderPackageCode);
// map.put("groundingStatus", groundingStatus);
// map.put("warehouseId", warehouseId);
//将消息携带绑定键值
// rabbitTemplate.convertAndSend(RabbitConstant.ORDER_PACKAGE_STATUS_INFO_EXCHANGE, RabbitConstant.ORDER_PACKAGE_STATUS_INFO_ROUTING, map);
// log.info(">>>>> 发送消息给MQ end 包件{}",orderPackageCode);
}
/**
@ -220,23 +220,23 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}
@Override
public List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(String orderCode,Long warehouseId) {
return baseMapper.findALLNoUpShelfPackageByOrderCode(orderCode,warehouseId);
public List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(String orderCode, Long warehouseId) {
return baseMapper.findALLNoUpShelfPackageByOrderCode(orderCode, warehouseId);
}
@Override
public IPage<DistributionParcelListEntity> pageOweList(IPage<Object> page, Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("parcelType");
if(ObjectUtils.isNotNull(o)){
if (ObjectUtils.isNotNull(o)) {
distributionParcelList.remove("parcelType");
}
DistributionParcelListDTO distributionParcelListDTO = JSONObject.parseObject(JSONObject.toJSONString(distributionParcelList), DistributionParcelListDTO.class);
if(Func.isNotEmpty(distributionParcelListDTO.getStockArticleIds())){
if (Func.isNotEmpty(distributionParcelListDTO.getStockArticleIds())) {
String trim = distributionParcelListDTO.getStockArticleIds().trim();
List<String> list = CommonUtil.stringNum(trim);
if(!list.isEmpty()){
if (!list.isEmpty()) {
distributionParcelListDTO.setStockArticleIdsList(list);
}else{
} else {
distributionParcelListDTO.setStockArticleIdsLike(trim);
}
//转库存品限制
@ -258,11 +258,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}*/
}
return baseMapper.pageOweList(page,distributionParcelListDTO);
return baseMapper.pageOweList(page, distributionParcelListDTO);
}
/**
* 查询已备货的数据
* 查询已备货的数据
*
* @param stockupDTO
* @return
*/
@ -282,38 +283,38 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
Object o = distributionParcelList.get("stockArticleId");
Object reservationId = distributionParcelList.get("reservationId");
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
if(ObjectUtils.isNotNull(o)){
String a= (String) o;
if(a.contains(",")){
queryWrapper.in("stock_article_id",a.split(","));
}else{
queryWrapper.eq("stock_article_id",a);
if (ObjectUtils.isNotNull(o)) {
String a = (String) o;
if (a.contains(",")) {
queryWrapper.in("stock_article_id", a.split(","));
} else {
queryWrapper.eq("stock_article_id", a);
}
}else{
} else {
return null;
}
List<DistributionParcelListEntity> distributionParcelListEntities = baseMapper.selectList(queryWrapper);
if(distributionParcelListEntities.isEmpty()){
if (distributionParcelListEntities.isEmpty()) {
return null;
}
List<DistributionParcelListZeroVO> list = new ArrayList<>();
distributionParcelListEntities.forEach( i ->{
distributionParcelListEntities.forEach(i -> {
//查询在库数量
DistributionParcelNumberEntity parcelNumber = distributionParcelNumberService.getOne(Wrappers.<DistributionParcelNumberEntity>query().lambda()
.eq(DistributionParcelNumberEntity::getParcelListId, i.getId())
.eq(DistributionParcelNumberEntity::getStockArticleId, i.getStockArticleId()));
.eq(DistributionParcelNumberEntity::getParcelListId, i.getId())
.eq(DistributionParcelNumberEntity::getStockArticleId, i.getStockArticleId()));
DistributionReservationZeroPackageEntity one = reservationZeroPackageService.getOne(Wrappers.<DistributionReservationZeroPackageEntity>query().lambda()
.eq(DistributionReservationZeroPackageEntity::getParcelListId, i.getId())
.eq(DistributionReservationZeroPackageEntity::getStockArticleId, i.getStockArticleId())
.eq(DistributionReservationZeroPackageEntity::getReservationId, reservationId)
);
DistributionParcelListZeroVO parcelListVO = new DistributionParcelListZeroVO();
BeanUtils.copyProperties(i,parcelListVO);
BeanUtils.copyProperties(i, parcelListVO);
parcelListVO.setLibraryQuantity(parcelNumber.getHandQuantity());
parcelListVO.setDeliveryQuantity(parcelNumber.getDeliveryQuantity());
if(ObjectUtils.isNotNull(one)){
if (ObjectUtils.isNotNull(one)) {
parcelListVO.setReservationQuantity(one.getQuantity());
}else{
} else {
parcelListVO.setReservationQuantity(0);
}
list.add(parcelListVO);
@ -323,6 +324,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/**
* 修改零担在库数量
*
* @param distributionParcelList
* @return
*/
@ -330,47 +332,46 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
public int getZeroUpdateMaterial(Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("stockArticleId"); //订单ID
Object parcelListZeroVO = distributionParcelList.get("distributionParcelListZeroVO");
if(ObjectUtils.isNull(parcelListZeroVO)){
if (ObjectUtils.isNull(parcelListZeroVO)) {
throw new ServiceException("修改参数为空!!!");
}
List<DistributionParcelListZeroVO> list = (List<DistributionParcelListZeroVO>) parcelListZeroVO;
String jsonString = JSON.toJSONString(list);
list =JSON.parseArray(jsonString,DistributionParcelListZeroVO.class);
list = JSON.parseArray(jsonString, DistributionParcelListZeroVO.class);
list.stream().forEach(i -> {
DistributionParcelListZeroVO parcelZeroVO = JSONObject.parseObject(JSONObject.toJSONString(i), DistributionParcelListZeroVO.class);
if(!parcelZeroVO.getTiQuantity().equals(0) || parcelZeroVO.getTiQuantity() <= parcelZeroVO.getDeliveryQuantity()){
//修改
boolean update = distributionParcelNumberService.update(Wrappers.<DistributionParcelNumberEntity>update()
.eq("parcel_list_id", parcelZeroVO.getId())
.set("hand_quantity", parcelZeroVO.getTiQuantity())
);
DistributionParcelListZeroVO parcelZeroVO = JSONObject.parseObject(JSONObject.toJSONString(i), DistributionParcelListZeroVO.class);
if (!parcelZeroVO.getTiQuantity().equals(0) || parcelZeroVO.getTiQuantity() <= parcelZeroVO.getDeliveryQuantity()) {
//修改
boolean update = distributionParcelNumberService.update(Wrappers.<DistributionParcelNumberEntity>update()
.eq("parcel_list_id", parcelZeroVO.getId())
.set("hand_quantity", parcelZeroVO.getTiQuantity())
);
}
}
});
});
return 1;
}
@Override
public Integer selectSumByOrderId(Long orderId, Long warehouseId) {
baseMapper.selectCount(new QueryWrapper<DistributionParcelListEntity>().lambda()
.eq(DistributionParcelListEntity::getIsDeleted,0)
.eq(DistributionParcelListEntity::getStockArticleId,orderId)
.eq(DistributionParcelListEntity::getIsDeleted, 0)
.eq(DistributionParcelListEntity::getStockArticleId, orderId)
//在库数量
.eq(null!=warehouseId,DistributionParcelListEntity::getWarehouseId,warehouseId)
.eq(null!=warehouseId,DistributionParcelListEntity::getOrderPackageLoadingStatus,"10")
.in(null!=warehouseId,DistributionParcelListEntity::getOrderPackageStatus,"20,30,40")
.eq(null != warehouseId, DistributionParcelListEntity::getWarehouseId, warehouseId)
.eq(null != warehouseId, DistributionParcelListEntity::getOrderPackageLoadingStatus, "10")
.in(null != warehouseId, DistributionParcelListEntity::getOrderPackageStatus, "20,30,40")
);
return null;
}
@Override
public List<DistributionParcelListEntity> getParcelListByStockArticleId(Long id) {
return this.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId,id));
return this.list(Wrappers.<DistributionParcelListEntity>query().lambda().eq(DistributionParcelListEntity::getStockArticleId, id));
}
/**
*
* @param distributionParcelList
* @return
*/
@ -378,9 +379,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
public List<DistributionParcelListBaseVO> getStockDataBase(Map<String, Object> distributionParcelList) {
DistributionParcelListEntity parcelListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionParcelList), DistributionParcelListEntity.class);
List<DistributionParcelListBaseVO> stockDataBase = baseMapper.getStockDataBase(parcelListEntity);
stockDataBase.forEach( i ->{
if(StringUtils.isNotBlank(i.getTypeService())){
i.setTypeServiceName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE,i.getTypeService()));
stockDataBase.forEach(i -> {
if (StringUtils.isNotBlank(i.getTypeService())) {
i.setTypeServiceName(DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, i.getTypeService()));
}
});
return stockDataBase;
@ -394,6 +395,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/**
* 包件转库存品
*
* @param distributionParcelList
* @return
*/
@ -401,34 +403,34 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Transactional(rollbackFor = Exception.class)
public R packageTransferStock(Map<String, Object> distributionParcelList) {
Object o = distributionParcelList.get("ids");
if(ObjectUtils.isNull(o)){
if (ObjectUtils.isNull(o)) {
return R.fail("参数不完整!");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("请选择仓库!");
}
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
String s = String.valueOf(o);
if(s.contains(",")){
if (s.contains(",")) {
String[] split = s.split(",");
queryWrapper.in("id",split);
}else{
queryWrapper.eq("id",o);
queryWrapper.in("id", split);
} else {
queryWrapper.eq("id", o);
}
queryWrapper.eq("conditions",1);
queryWrapper.eq("conditions", 1);
List<DistributionParcelListEntity> list1 = baseMapper.selectList(queryWrapper);
boolean b = list1.stream().anyMatch(i -> ObjectUtils.isNull(i.getMaterialId()));
if(b){
if (b) {
throw new ServiceException("有包件未维护物料信息,请维护后在进行操作!!");
}
if (!list1.isEmpty()) {
Set<Long> listString = new HashSet<>();
list1.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getMaterialId))
.forEach((k ,v) ->{
.forEach((k, v) -> {
int sum = v.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
List<Long> packageIds = new ArrayList<>();
v.stream().forEach( i -> {
v.stream().forEach(i -> {
//查询有没有打托数据
//查询包件有没有物料
@ -438,9 +440,9 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
if (!list.isEmpty()) {
//有
list.stream().collect(Collectors.groupingBy(DistributionParcelDetailsEntity::getEncoded))
.forEach((kk,vv) ->{
.forEach((kk, vv) -> {
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(vv.get(0),parcelListEntity);
BeanUtil.copyProperties(vv.get(0), parcelListEntity);
parcelListEntity.setQuantity(sum);
parcelListEntity.setMaterialName(vv.get(0).getName());
parcelListEntity.setMaterialCode(vv.get(0).getEncoded());
@ -448,10 +450,10 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
// 添加库存品信息
//查询在库订单信息
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId()) ) {
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) {
throw new ServiceException("订单的客户数据异常,无法转换!!");
}
addStockList(distributionStockArticleEntity,parcelListEntity, 1);
addStockList(distributionStockArticleEntity, parcelListEntity, 1);
});
}
//修改状态
@ -464,21 +466,21 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
packageIds.add(parcelList.getId());
});
DistributionParcelListEntity parcelListEntity = new DistributionParcelListEntity();
BeanUtil.copyProperties(v.get(0),parcelListEntity);
BeanUtil.copyProperties(v.get(0), parcelListEntity);
parcelListEntity.setQuantity(sum);
// 添加库存品信息
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId()) ) {
if (ObjectUtil.isEmpty(distributionStockArticleEntity.getMallId())) {
throw new ServiceException("订单的客户数据异常,无法转换!!");
}
addStockListByPackage(distributionStockArticleEntity,packageIds, 1);
addStockListByPackage(distributionStockArticleEntity, packageIds, 1);
});
listString.forEach( oo -> {
listString.forEach(oo -> {
DistributionStockArticleEntity stockArticleEntity1 = distributionStockArticleMapper.selectById(oo);
if(ObjectUtils.isNull(stockArticleEntity1)){
if (ObjectUtils.isNull(stockArticleEntity1)) {
throw new ServiceException("订单不存在!");
}
if(stockArticleEntity1.getTotalNumber().equals(list1.size())){
if (stockArticleEntity1.getTotalNumber().equals(list1.size())) {
//修改订单状态
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo);
@ -494,14 +496,14 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
.eq(DistributionParcelListEntity::getConditions, 2)
);
if(!distributionParcelListEntities.isEmpty() && stockArticleEntity1.getTotalNumber().equals(distributionParcelListEntities.size())){
if (!distributionParcelListEntities.isEmpty() && stockArticleEntity1.getTotalNumber().equals(distributionParcelListEntities.size())) {
//修改订单状态
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); //修改
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(oo); //修改
stockArticleEntity.setId(oo);
stockArticleEntity.setGenre(2);
stockArticleEntity.setTotalNumber(stockArticleEntity.getTotalNumber() - list1.size());
distributionStockArticleMapper.updateById(stockArticleEntity);
}else {
} else {
DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleMapper.selectById(oo);
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() - list1.size());
distributionStockArticleEntity.setTotalNumber(distributionStockArticleEntity.getTotalNumber() - list1.size());
@ -530,7 +532,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
parcelListEntity.setConditions(1);
IPage<DistributionParcelListEntity> distributionParcelListEntityIPage = baseMapper.pageOweList(page, parcelListEntity);
List<DistributionParcelListEntity> list = new ArrayList<>();
distributionParcelListEntityIPage.getRecords().forEach( i ->{
distributionParcelListEntityIPage.getRecords().forEach(i -> {
DistrilbutionBillPackageEntity one = distrilbutionBillPackageService.getOne(Wrappers.<DistrilbutionBillPackageEntity>query().lambda()
.eq(DistrilbutionBillPackageEntity::getStockArticleId, i.getStockArticleId())
.eq(DistrilbutionBillPackageEntity::getBillLadingId, reservationId)
@ -538,8 +540,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
.apply("packet_bar_status in (1,3)")
);
DistributionParcelListEntity parcelListVO = new DistributionParcelListEntity();
BeanUtils.copyProperties(i,parcelListVO);
parcelListVO.setChoice(ObjectUtils.isNotNull(one) ? true : false);
BeanUtils.copyProperties(i, parcelListVO);
parcelListVO.setChoice(ObjectUtils.isNotNull(one) ? true : false);
list.add(parcelListVO);
});
distributionParcelListEntityIPage.setRecords(list);
@ -548,6 +550,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/**
* 查询包件数据
*
* @param parcelListVO
* @return
*/
@ -574,13 +577,13 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
// 获取当前登录的仓库信息
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNull(myCurrentWarehouse)){
if (ObjectUtils.isNull(myCurrentWarehouse)) {
throw new ServiceException("没有仓库信息!");
}
// 用户勾选数据的ids
Object ids = paramMap.get("ids");
List<String> idArr = null;
if (null != ids && !ids.toString().equals("")){
if (null != ids && !ids.toString().equals("")) {
idArr = Arrays.asList(paramMap.get("ids").toString().split(","));
}
@ -596,8 +599,8 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
}
@Override
public void freezeByOrderCode(String orderCode,String freezeStatus) {
baseMapper.freezeByOrderCode(orderCode,freezeStatus);
public void freezeByOrderCode(String orderCode, String freezeStatus) {
baseMapper.freezeByOrderCode(orderCode, freezeStatus);
}
@Override
@ -607,12 +610,12 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
@Override
public void updateOrderPackageCodeById(Long packageId, String orderPackageStatus) {
baseMapper.updateOrderPackageCodeById(packageId,orderPackageStatus);
baseMapper.updateOrderPackageCodeById(packageId, orderPackageStatus);
}
@Override
public DistributionParcelListEntity selectByOrderPackageCode(String orderPackageCode, Long warehouseId) {
return baseMapper.selectByOrderPackageCode(orderPackageCode,warehouseId);
return baseMapper.selectByOrderPackageCode(orderPackageCode, warehouseId);
}
/**
@ -620,7 +623,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
* @return
*/
@Transactional(rollbackFor = Exception.class)
public DistributionStockArticleEntity addStockList(DistributionStockArticleEntity distributionStockArticleEntity,DistributionParcelListEntity distributionParcelList, Integer qu) {
public DistributionStockArticleEntity addStockList(DistributionStockArticleEntity distributionStockArticleEntity, DistributionParcelListEntity distributionParcelList, Integer qu) {
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity();
@ -658,16 +661,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelList.getMaterialId(), distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId());
if(ObjectUtils.isNotNull(stockListEntity)){
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelList.getMaterialId(), distributionStockArticleEntity.getOrderCode(), distributionStockArticleEntity.getStoreId(), distributionStockArticleEntity.getWarehouseId());
if (ObjectUtils.isNotNull(stockListEntity)) {
//有记录
DistributionStockListEntity listEntity = new DistributionStockListEntity();
listEntity.setId(stockListEntity.getId());//id
Integer quantity = ObjectUtils.isNull(distributionParcelList.getQuantity()) ? 0: distributionParcelList.getQuantity();
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock();
Integer quantity = ObjectUtils.isNull(distributionParcelList.getQuantity()) ? 0 : distributionParcelList.getQuantity();
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock();
listEntity.setQuantityStock(quantity + quantityStock);
distributionStockListService.updateById(listEntity);
}else{
} else {
distributionStockListService.save(distributionStockListEntity);
}
distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null)); //托盘
@ -679,7 +682,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
//添加库存品记录
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity();
BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo);
BeanUtil.copyProperties(distributionStockListEntity, distributionStockListInfo);
distributionStockListInfo.setWarehousingTime(distributionStockArticleEntity.getWarehouseEntryTime());
distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId());
// distributionStockListInfo.setLicensePlate(distributionStockArticleEntity.get); //车牌
@ -687,31 +690,32 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionStockListInfoService.save(distributionStockListInfo);
return distributionStockArticleEntity;
}
@Transactional(rollbackFor = Exception.class)
public DistributionStockArticleEntity addStockListByPackage(DistributionStockArticleEntity distributionStockArticleEntity,List<Long> packageIds, Integer qu) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
//当前无选择仓库
return null;
}
List<DistributionParcelListEntity> distributionParcelListEntities = this.listByIds(packageIds);
List<Long> materialId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialId).distinct().collect(Collectors.toList());
List<String> materialCode = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialCode).distinct().collect(Collectors.toList());
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList());
List<Long> mallId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMallId).distinct().collect(Collectors.toList());
List<String> materialName= distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList());
List<Long> brandId= distributionParcelListEntities.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList());
if (materialId.size()!=1 ||materialCode.size()!=1 ||materialUnit.size()!=1 ||mallId.size()!=1 || materialName.size()!=1 || brandId.size()!=1 ){
//该批次包件出现多种物料包件
return null;
}
int num = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
if (num <= 0){
//无有效的在库数量
return null;
}
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity();
@Transactional(rollbackFor = Exception.class)
public DistributionStockArticleEntity addStockListByPackage(DistributionStockArticleEntity distributionStockArticleEntity, List<Long> packageIds, Integer qu) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
//当前无选择仓库
return null;
}
List<DistributionParcelListEntity> distributionParcelListEntities = this.listByIds(packageIds);
List<Long> materialId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialId).distinct().collect(Collectors.toList());
List<String> materialCode = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialCode).distinct().collect(Collectors.toList());
List<String> materialUnit = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialUnit).distinct().collect(Collectors.toList());
List<Long> mallId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMallId).distinct().collect(Collectors.toList());
List<String> materialName = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getMaterialName).distinct().collect(Collectors.toList());
List<Long> brandId = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getBrandId).distinct().collect(Collectors.toList());
if (materialId.size() != 1 || materialCode.size() != 1 || materialUnit.size() != 1 || mallId.size() != 1 || materialName.size() != 1 || brandId.size() != 1) {
//该批次包件出现多种物料包件
return null;
}
int num = distributionParcelListEntities.stream().mapToInt(DistributionParcelListEntity::getQuantity).sum();
if (num <= 0) {
//无有效的在库数量
return null;
}
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity();
//直接添加
// distributionStockListEntity.setIncomingBatch(distributionStockArticleEntity.get); //入库批次号
distributionStockListEntity.setServiceNumber(Optional.ofNullable(distributionStockArticleEntity.getServiceNumber()).orElse(null)); //服务号
@ -746,16 +750,16 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
// distributionStockListEntity.setParcelListId(distributionParcelListEntities.getId());//包件id
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
distributionStockListEntity.setServiceType(distributionStockArticleEntity.getTypeService());//冻结数量
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelListEntities.get(0).getMaterialId(), distributionStockArticleEntity.getOrderCode(),distributionStockArticleEntity.getStoreId(),distributionStockArticleEntity.getWarehouseId());
if(ObjectUtils.isNotNull(stockListEntity)){
DistributionStockListEntity stockListEntity = distributionStockListService.getStockListEntity(distributionStockArticleEntity.getMallId(), distributionParcelListEntities.get(0).getMaterialId(), distributionStockArticleEntity.getOrderCode(), distributionStockArticleEntity.getStoreId(), distributionStockArticleEntity.getWarehouseId());
if (ObjectUtils.isNotNull(stockListEntity)) {
//有记录
DistributionStockListEntity listEntity = new DistributionStockListEntity();
listEntity.setId(stockListEntity.getId());//id
Integer quantity = ObjectUtils.isNull(distributionParcelListEntities.get(0).getQuantity()) ? 0: distributionParcelListEntities.get(0).getQuantity();
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock();
Integer quantity = ObjectUtils.isNull(distributionParcelListEntities.get(0).getQuantity()) ? 0 : distributionParcelListEntities.get(0).getQuantity();
Integer quantityStock = ObjectUtils.isNull(stockListEntity.getQuantityStock()) ? 0 : stockListEntity.getQuantityStock();
listEntity.setQuantityStock(quantity + quantityStock);
distributionStockListService.updateById(listEntity);
}else{
} else {
distributionStockListService.save(distributionStockListEntity);
}
// distributionStockListEntity.setTrayName(Optional.ofNullable(distributionParcelList.getPallet()).orElse(null)); //托盘
@ -766,62 +770,62 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
// distributionStockListEntity.setOrderCode(Optional.ofNullable(distributionParcelListEntities.get(0).getOrderCode()).orElse(null)); //订单自编号
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
//添加库存品记录
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity();
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
//添加库存品记录
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity();
// BeanUtil.copyProperties(distributionStockListEntity,distributionStockListInfo);
distributionStockListInfo.setServiceNumber(distributionStockListEntity.getServiceNumber()); //服务号
distributionStockListInfo.setDescriptionGoods(distributionStockListEntity.getMallName()); //物料名称
distributionStockListInfo.setCargoNumber(distributionStockListEntity.getCargoNumber()); //物料编号
distributionStockListInfo.setWarehouseName(distributionStockListEntity.getWarehouseName()); //仓库
distributionStockListInfo.setWarehouseId(distributionStockListEntity.getWarehouseId()); //仓库ID
distributionStockListInfo.setMarketId(distributionStockListEntity.getMarketId()); //商场
distributionStockListInfo.setCargoUnit(distributionStockListEntity.getCargoUnit()); //货物单位
distributionStockListInfo.setServiceNumber(distributionStockListEntity.getServiceNumber()); //服务号
distributionStockListInfo.setDescriptionGoods(distributionStockListEntity.getMallName()); //物料名称
distributionStockListInfo.setCargoNumber(distributionStockListEntity.getCargoNumber()); //物料编号
distributionStockListInfo.setWarehouseName(distributionStockListEntity.getWarehouseName()); //仓库
distributionStockListInfo.setWarehouseId(distributionStockListEntity.getWarehouseId()); //仓库ID
distributionStockListInfo.setMarketId(distributionStockListEntity.getMarketId()); //商场
distributionStockListInfo.setCargoUnit(distributionStockListEntity.getCargoUnit()); //货物单位
distributionStockListInfo.setMallName(distributionStockListEntity.getMallName()); //商场名称
distributionStockListInfo.setQuantityStock(distributionParcelListEntity.getQuantity()); //库存数量(包件数量)
distributionStockListInfo.setIncomingBatch(distributionStockListEntity.getIncomingBatch()); //入库批次
distributionStockListInfo.setOutboundQuantity(0); //出库数量
distributionStockListInfo.setOutboundQuantity(0); //入库时间
distributionStockListInfo.setMallName(distributionStockListEntity.getMallName()); //商场名称
distributionStockListInfo.setQuantityStock(distributionParcelListEntity.getQuantity()); //库存数量(包件数量)
distributionStockListInfo.setIncomingBatch(distributionStockListEntity.getIncomingBatch()); //入库批次
distributionStockListInfo.setOutboundQuantity(0); //出库数量
distributionStockListInfo.setOutboundQuantity(0); //入库时间
// distributionStockListEntity.setCargoUnit(Optional.ofNullable(distributionParcelList.getMaterialUnit()).orElse(null));//单位
distributionStockListInfo.setStoreId(distributionStockListEntity.getStoreId());//门店ID
distributionStockListInfo.setMarketCode(distributionStockListEntity.getMarketCode());//商场编码
distributionStockListInfo.setMarketName(distributionStockListEntity.getMarketName());//商场名称
distributionStockListInfo.setStoreCode(distributionStockListEntity.getStoreCode());//门店编码
distributionStockListInfo.setStoreName(distributionStockListEntity.getStoreName());//门店名称
distributionStockListInfo.setStoreId(distributionStockListEntity.getStoreId());//门店ID
distributionStockListInfo.setMarketCode(distributionStockListEntity.getMarketCode());//商场编码
distributionStockListInfo.setMarketName(distributionStockListEntity.getMarketName());//商场名称
distributionStockListInfo.setStoreCode(distributionStockListEntity.getStoreCode());//门店编码
distributionStockListInfo.setStoreName(distributionStockListEntity.getStoreName());//门店名称
// distributionStockListEntity.setCategory(Optional.ofNullable(distributionParcelList.getBrandId()+"").orElse(null));//品分类
// 品牌
distributionStockListInfo.setBrandId(distributionStockListEntity.getBrandId());
distributionStockListInfo.setUnpackingQuantity(0);
distributionStockListInfo.setSourceType("1"); //类型
// 品牌
distributionStockListInfo.setBrandId(distributionStockListEntity.getBrandId());
distributionStockListInfo.setUnpackingQuantity(0);
distributionStockListInfo.setSourceType("1"); //类型
distributionStockListInfo.setSku(distributionStockListEntity.getSku());
distributionStockListInfo.setMaterialId(distributionStockListEntity.getMaterialId());//货物ID
distributionStockListInfo.setSku(distributionStockListEntity.getSku());
distributionStockListInfo.setMaterialId(distributionStockListEntity.getMaterialId());//货物ID
// distributionStockListEntity.setParcelListId(distributionParcelListEntities.getId());//包件id
distributionStockListInfo.setQuantityOccupied(0);//冻结数量
distributionStockListInfo.setServiceType(distributionStockListEntity.getServiceType());//冻结数
//需要包件维度的详情
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseUpdownGoodsEntity.setAssociationType("3");
warehouseUpdownGoodsEntity.setAssociationValue(distributionParcelListEntity.getOrderPackageCode());
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity);
if (Func.isNotEmpty(locationInformation)){
distributionStockListInfo.setQuantityOccupied(0);//冻结数量
distributionStockListInfo.setServiceType(distributionStockListEntity.getServiceType());//冻结数
//需要包件维度的详情
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId());
warehouseUpdownGoodsEntity.setAssociationType("3");
warehouseUpdownGoodsEntity.setAssociationValue(distributionParcelListEntity.getOrderPackageCode());
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity);
if (Func.isNotEmpty(locationInformation)) {
// distributionStockListInfo.setTrayName(locationInformation.get);
distributionStockListInfo.setStorageLocation(locationInformation.getAllocationTitle());
distributionStockListInfo.setStorageLocation(locationInformation.getAllocationTitle());
}
distributionStockListInfo.setFactory(distributionStockArticleEntity.getFactoryTrain());
distributionStockListInfo.setDespatch(distributionStockArticleEntity.getTrainNumber());
distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId());
distributionStockListInfo.setOrderCode(distributionStockArticleEntity.getOrderCode());
distributionStockListInfo.setParcelListId(distributionParcelListEntity.getId());
distributionStockListInfo.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
distributionStockListInfoService.save(distributionStockListInfo);
}
distributionStockListInfo.setFactory(distributionStockArticleEntity.getFactoryTrain());
distributionStockListInfo.setDespatch(distributionStockArticleEntity.getTrainNumber());
distributionStockListInfo.setStockArticleId(distributionStockArticleEntity.getId());
distributionStockListInfo.setOrderCode(distributionStockArticleEntity.getOrderCode());
distributionStockListInfo.setParcelListId(distributionParcelListEntity.getId());
distributionStockListInfo.setPackageCode(distributionParcelListEntity.getOrderPackageCode());
distributionStockListInfoService.save(distributionStockListInfo);
}
return distributionStockArticleEntity;
}

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

@ -1,5 +1,6 @@
package com.logpm.distribution.wrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient;
@ -11,6 +12,7 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictBizCache;
import java.text.SimpleDateFormat;
import java.util.Objects;
/**
@ -33,8 +35,14 @@ public class DistributionParcelListWrapper extends BaseEntityWrapper<Distributio
public DistributionParcelListVO entityVO(DistributionParcelListEntity entity) {
// IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient = SpringUtil.getBean(IWarehouseUpdownGoodsClient.class);
// IWarehouseTrayGoodsClient warehouseTrayGoodsClient = SpringUtil.getBean(IWarehouseTrayGoodsClient.class);
DistributionParcelListVO parcelListVO = Objects.requireNonNull(BeanUtil.copy(entity,DistributionParcelListVO.class));
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
if(ObjectUtils.isNotNull(entity.getScanTimes())){
parcelListVO.setScanTime(format.format(entity.getScanTimes()));
}
if(ObjectUtils.isNotNull(entity.getSigningTimes())){
parcelListVO.setSigningTime(format.format(entity.getSigningTimes()));
}
parcelListVO.setOrderPackageStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STATUS, entity.getOrderPackageStatus()));
parcelListVO.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, entity.getOrderPackageFreezeStatus()));
parcelListVO.setOrderPackageGroundingStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_GROUNDING_STATUS, entity.getOrderPackageGroundingStatus()));

17
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -392,14 +392,20 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
takeCompany = supplyData.get("takeCompany");
}
OrderDetailEntity orderDetailEntity = orderDetailClient.findByUnitNo(unitNo);
if(Objects.isNull(orderDetailEntity)){
logger.warn("############handleDataToPlatform: 包条信息不存在 unitNo={}",unitNo);
throw new CustomerException(405, "包条信息不存在");
}
Integer oldId = orderDetailEntity.getNowWarehouseId();
// 查询数据对应的仓库名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse);
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldId);
if(Objects.isNull(basicdataWarehouseEntity)){
logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse);
throw new CustomerException(405, "仓库信息不存在");
}
Long warehouseId = basicdataWarehouseEntity.getId();
Integer oldId = basicdataWarehouseEntity.getOldId();
// OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderSelfNum,oldId);
// if(Objects.isNull(orderCountEntity)){
@ -423,6 +429,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity = new DistributionStockArticleEntity();
distributionStockArticleEntity.setOrderCode(orderSelfNum);
distributionStockArticleEntity.setWaybillNumber(waybillNoNum);
distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName());
distributionStockArticleEntity.setWarehouseId(warehouseId);
// 其实是客户
distributionStockArticleEntity.setMallName(takeCompany);
@ -482,10 +491,6 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
if(ObjectUtils.isNotNull(t)){
distributionStockArticleEntity.setAcceptWarehouseName(t.getName());
distributionStockArticleEntity.setAcceptWarehouseId(t.getId());
// TODO 这里存在问题 后需要知道当前作业仓库
distributionStockArticleEntity.setWarehouse(t.getName());
distributionStockArticleEntity.setWarehouseId(t.getId());
}
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/TrayClient.java

@ -24,4 +24,9 @@ public class TrayClient implements ITrayClient{
public TrayEntity getTrayById(Integer trayId) {
return trayService.getTrayById(trayId);
}
@Override
public TrayEntity getTrayByTrayNo(String trayNo) {
return trayService.getTrayByTrayNo(trayNo);
}
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.java

@ -3,7 +3,9 @@ package com.logpm.oldproject.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.oldproject.entity.TrayEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface TrayMapper extends BaseMapper<TrayEntity> {
TrayEntity getTrayByTrayNo(@Param("trayNo") String trayNo);
}

6
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/TrayMapper.xml

@ -2,4 +2,10 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.logpm.oldproject.mapper.TrayMapper">
<select id="getTrayByTrayNo" resultType="com.logpm.oldproject.entity.TrayEntity">
select *
from ht_tray
where tray_no = #{trayNo}
</select>
</mapper>

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/ITrayService.java

@ -11,4 +11,5 @@ public interface ITrayService {
TrayEntity getTrayById(Integer trayId);
TrayEntity getTrayByTrayNo(String trayNo);
}

5
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/TrayServiceImpl.java

@ -28,4 +28,9 @@ public class TrayServiceImpl implements ITrayService {
public TrayEntity getTrayById(Integer trayId) {
return trayMapper.selectById(trayId);
}
@Override
public TrayEntity getTrayByTrayNo(String trayNo) {
return trayMapper.getTrayByTrayNo(trayNo);
}
}

42
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/OldSystemPushController.java

@ -194,5 +194,47 @@ public class OldSystemPushController {
}
@ResponseBody
@PostMapping("/addCreateTrayData")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "老系统创建托盘数据", notes = "传入waybillDTO")
public R addCreateTrayData(@RequestBody TrayInfoDTO trayInfoDTO) {
log.info("############addCreateTrayData: 请求参数{}",trayInfoDTO);
try{
List<String> trayNos = trayInfoDTO.getTrayNos();
Integer warehouseId = trayInfoDTO.getWarehouseId();
if(trayNos.size() == 0){
log.warn("##############addCreateTrayData: 托盘id不存在 trayNos={}",trayNos);
return R.fail(405,"托盘id不存在");
}
if(Objects.isNull(warehouseId)){
log.warn("##############addCreateTrayData: 仓库id不存在 warehouseId={}",warehouseId);
return R.fail(405,"仓库id不存在");
}
//先保存原始请求数据
WarehouseLog warehouseLog = new WarehouseLog();
warehouseLog.setArgs(JSONObject.toJSONString(trayInfoDTO));
warehouseLog.setStatus(0);
warehouseLog.setType(3);
warehouseLogService.save(warehouseLog);
asyncDataService.addCreateTrayData(trayInfoDTO);
warehouseLog.setStatus(1);
warehouseLogService.updateById(warehouseLog);
return R.success("操作成功");
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error("############sendOrders: 系统异常",e);
return R.fail(500,"############sendOrders: 系统异常");
}
}
}

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TrayInfoDTO.java

@ -3,6 +3,8 @@ package com.logpm.warehouse.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data
public class TrayInfoDTO implements Serializable {
@ -12,4 +14,6 @@ public class TrayInfoDTO implements Serializable {
private String orderPackageCode;
private Integer type;
private List<String> trayNos = new ArrayList<>();
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IAsyncDataService.java

@ -8,4 +8,6 @@ public interface IAsyncDataService {
void syncTaskData(String questNum, Long warehouseId);
void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO);
void addCreateTrayData(TrayInfoDTO trayInfoDTO);
}

38
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/AsyncDataServiceImpl.java

@ -471,6 +471,44 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
}
}
@Override
public void addCreateTrayData(TrayInfoDTO trayInfoDTO) {
List<String> trayNos = trayInfoDTO.getTrayNos();
Integer oldWarehouseId = trayInfoDTO.getWarehouseId();
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldWarehouseId);
if(Objects.isNull(basicdataWarehouseEntity)){
log.error("###############addCreateTrayData: 仓库信息不存在 oldWarehouseId={}",oldWarehouseId);
throw new CustomerException(405,"仓库信息不存在");
}
Long warehouseId = basicdataWarehouseEntity.getId();
for (String trayNo : trayNos) {
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayNo(trayNo);
if(Objects.isNull(basicdataTrayEntity)){
log.info("############sendTrayInfoByOrderPackageCode: 托盘信息不存在 同步");
//如果托盘不存在就去同步该托盘
TrayEntity trayEntity = trayClient.getTrayByTrayNo(trayNo);
basicdataTrayEntity = new BasicdataTrayEntity();
basicdataTrayEntity.setTenantId("627683");
basicdataTrayEntity.setCreateUser(1714696768639311873L);
basicdataTrayEntity.setUpdateUser(1714696768639311873L);
basicdataTrayEntity.setCreateDept(1649331096241836033L);
basicdataTrayEntity.setPalletName(trayEntity.getTrayNo());
basicdataTrayEntity.setPalletCode("T"+trayEntity.getId());
basicdataTrayEntity.setWarehouseId(warehouseId);
basicdataTrayEntity.setTrayStatus(trayEntity.getStatus()+"");
basicdataTrayEntity.setType(1);
basicdataTrayEntity.setOldId(trayEntity.getId());
// basicdataTrayEntity.setNowWarehouseId(nowNewWarehouseId);
Long aLong = basicdataTrayClient.addTray(basicdataTrayEntity);
basicdataTrayEntity.setId(aLong);
}
}
}
private void dealWithStockTray(String materialCode, String marketName, String incomingBatch, Integer stockNum, String trayCode, String trayType, Long warehouseId) {
log.info("#############dealWithStockTray: 处理库存品的打托");

Loading…
Cancel
Save