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. 39
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  15. 34
      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) @GetMapping(GETTRAYENTITYLIST)
List<BasicdataTrayEntity> 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 = "订单自编号") @ApiModelProperty(value = "订单自编号")
private String orderCode; 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 = "指派状态") @ApiModelProperty(value = "指派状态")
private String assignStatusName; 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; package com.logpm.distribution.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -126,10 +128,43 @@ public class DistributionParcelListVO extends DistributionParcelListEntity {
* 签收数量 * 签收数量
*/ */
private Date loadingTime; 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") @GetMapping(API_PREFIX+"/getTrayById")
TrayEntity getTrayById(@RequestParam Integer trayId); TrayEntity getTrayById(@RequestParam Integer trayId);
@GetMapping(API_PREFIX+"/getTrayByTrayNo")
TrayEntity getTrayByTrayNo(@RequestParam String trayNo);
// @GetMapping(API_PREFIX + "/getOrderByOrderSelfNum") // @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(); 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 * @return
*/ */
Integer selectAbnormalSigningByReservationId(@Param("reservationId")Long reservationId); 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 COUNT(received_quantity) FROM logpm_distribution_loadscan WHERE is_abnormal_signing = 2 AND signfor_state = 2 AND reservation_id = #{reservationId}
</select> </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> </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 * @return
*/ */
Integer statisticsLoadingNum(@Param("deliveryListId") Long deliveryId); 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 id="statisticsLoadingNum" resultType="java.lang.Integer">
SELECT COUNT(ldl.loaded_nub) FROM logpm_distribution_loadscaninvn AS ldl WHERE delivery_id = #{deliveryListId} SELECT COUNT(ldl.loaded_nub) FROM logpm_distribution_loadscaninvn AS ldl WHERE delivery_id = #{deliveryListId}
</select> </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> </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.warehouse_entry_time_end warehouseEntryTimeEnd,
ldpl.waybill_number waybillNumber, ldpl.waybill_number waybillNumber,
lwug.position_code goodsAllocation, 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 FROM
logpm_distribution_parcel_list ldpl logpm_distribution_parcel_list ldpl
LEFT JOIN logpm_warehouse_updown_goods lwug ON ldpl.id = lwug.association_id 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_tray_goods lwtg ON ldpl.id = lwtg.association_id
left join logpm_warehouse_warehouse lww on lww.id = ldpl.warehouse_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> <where>
ldpl.is_deleted = 0 ldpl.is_deleted = 0
<if test="param.warehouse !='' and param.warehouse != null"> <if test="param.warehouse !='' and param.warehouse != null">
and lww.name like concat('%',#{param.warehouse},'%') and lww.name like concat('%',#{param.warehouse},'%')
</if> </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"> <if test="param.orderPackageGroundingStatus !='' and param.orderPackageGroundingStatus != null">
and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus} and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus}
@ -192,6 +226,12 @@
<if test="param.orderPackageFreezeStatus !='' and param.orderPackageFreezeStatus != null"> <if test="param.orderPackageFreezeStatus !='' and param.orderPackageFreezeStatus != null">
and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus} and ldpl.order_package_freeze_status = #{param.orderPackageFreezeStatus}
</if> </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"> <if test="param.pallet !='' and param.pallet != null">
and lwtg.tray_code = #{param.pallet} and lwtg.tray_code = #{param.pallet}
</if> </if>

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

@ -359,10 +359,12 @@
ldpl.firsts firsts, ldpl.firsts firsts,
ldpl.SECOND SECOND, ldpl.SECOND SECOND,
ldpl.third_product thirdProduct, 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 FROM
logpm_distribution_reservation_package ldrp logpm_distribution_reservation_package ldrp
JOIN logpm_distribution_parcel_list ldpl ON ldpl.id = ldrp.parce_list_id 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> <where>
ldrp.stock_article_id = #{param.id} ldrp.stock_article_id = #{param.id}
</where> </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); 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){ }catch (Exception e){
// 更新状态报错 // 更新状态报错

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

34
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.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.order.OrderStockupStatusConstant; import org.springblade.common.constant.order.OrderStockupStatusConstant;
import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
@ -96,7 +97,6 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
private final RabbitTemplate rabbitTemplate; private final RabbitTemplate rabbitTemplate;
@Override @Override
public IPage<DistributionParcelListEntity> selectDistributionParcelListPage(IPage<DistributionParcelListEntity> page, DistributionParcelListVO distributionParcelList) { public IPage<DistributionParcelListEntity> selectDistributionParcelListPage(IPage<DistributionParcelListEntity> page, DistributionParcelListVO distributionParcelList) {
List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse(); List<BasicdataWarehouseEntity> myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();
@ -136,6 +136,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/** /**
* 查询备货包件信息 * 查询备货包件信息
*
* @param page * @param page
* @param distributionParcelList * @param distributionParcelList
* @return * @return
@ -178,30 +179,29 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
// 上架状态 // 上架状态
} }
@Override @Override
public void updateGroundingStatus(String orderPackageCode, String groundingStatus, Long warehouseId) { public void updateGroundingStatus(String orderPackageCode, String groundingStatus, Long warehouseId) {
try { try {
updateGroundingStatus(orderPackageCode,groundingStatus,warehouseId); // 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) { } catch (Exception e) {
log.error(">>>>>>> errr",e);
log.error("###############updateGroundingStatus: 更新上架状态失败 orderPackageCode={} warehouseId={} groundingStatus={}", orderPackageCode, warehouseId, groundingStatus); 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);
} }
/** /**
@ -263,6 +263,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/** /**
* 查询已备货的数据 * 查询已备货的数据
*
* @param stockupDTO * @param stockupDTO
* @return * @return
*/ */
@ -323,6 +324,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/** /**
* 修改零担在库数量 * 修改零担在库数量
*
* @param distributionParcelList * @param distributionParcelList
* @return * @return
*/ */
@ -370,7 +372,6 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
} }
/** /**
*
* @param distributionParcelList * @param distributionParcelList
* @return * @return
*/ */
@ -394,6 +395,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/** /**
* 包件转库存品 * 包件转库存品
*
* @param distributionParcelList * @param distributionParcelList
* @return * @return
*/ */
@ -548,6 +550,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
/** /**
* 查询包件数据 * 查询包件数据
*
* @param parcelListVO * @param parcelListVO
* @return * @return
*/ */
@ -687,6 +690,7 @@ public class DistributionParcelListServiceImpl extends BaseServiceImpl<Distribut
distributionStockListInfoService.save(distributionStockListInfo); distributionStockListInfoService.save(distributionStockListInfo);
return distributionStockArticleEntity; return distributionStockArticleEntity;
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public DistributionStockArticleEntity addStockListByPackage(DistributionStockArticleEntity distributionStockArticleEntity, List<Long> packageIds, Integer qu) { public DistributionStockArticleEntity addStockListByPackage(DistributionStockArticleEntity distributionStockArticleEntity, List<Long> packageIds, Integer qu) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();

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

@ -1,5 +1,6 @@
package com.logpm.distribution.wrapper; package com.logpm.distribution.wrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.vo.DistributionParcelListVO; import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.warehouse.feign.IWarehouseTrayGoodsClient; 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.core.tool.utils.SpringUtil;
import org.springblade.system.cache.DictBizCache; import org.springblade.system.cache.DictBizCache;
import java.text.SimpleDateFormat;
import java.util.Objects; import java.util.Objects;
/** /**
@ -33,8 +35,14 @@ public class DistributionParcelListWrapper extends BaseEntityWrapper<Distributio
public DistributionParcelListVO entityVO(DistributionParcelListEntity entity) { public DistributionParcelListVO entityVO(DistributionParcelListEntity entity) {
// IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient = SpringUtil.getBean(IWarehouseUpdownGoodsClient.class); // IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient = SpringUtil.getBean(IWarehouseUpdownGoodsClient.class);
// IWarehouseTrayGoodsClient warehouseTrayGoodsClient = SpringUtil.getBean(IWarehouseTrayGoodsClient.class); // IWarehouseTrayGoodsClient warehouseTrayGoodsClient = SpringUtil.getBean(IWarehouseTrayGoodsClient.class);
DistributionParcelListVO parcelListVO = Objects.requireNonNull(BeanUtil.copy(entity,DistributionParcelListVO.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.setOrderPackageStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STATUS, entity.getOrderPackageStatus()));
parcelListVO.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, entity.getOrderPackageFreezeStatus())); parcelListVO.setOrderPackageFreezeStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_FREEZE_STATUS, entity.getOrderPackageFreezeStatus()));
parcelListVO.setOrderPackageGroundingStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_GROUNDING_STATUS, entity.getOrderPackageGroundingStatus())); 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"); 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)){ if(Objects.isNull(basicdataWarehouseEntity)){
logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse); logger.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse);
throw new CustomerException(405, "仓库信息不存在"); throw new CustomerException(405, "仓库信息不存在");
} }
Long warehouseId = basicdataWarehouseEntity.getId(); Long warehouseId = basicdataWarehouseEntity.getId();
Integer oldId = basicdataWarehouseEntity.getOldId();
// OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderSelfNum,oldId); // OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderSelfNum,oldId);
// if(Objects.isNull(orderCountEntity)){ // if(Objects.isNull(orderCountEntity)){
@ -423,6 +429,9 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
distributionStockArticleEntity = new DistributionStockArticleEntity(); distributionStockArticleEntity = new DistributionStockArticleEntity();
distributionStockArticleEntity.setOrderCode(orderSelfNum); distributionStockArticleEntity.setOrderCode(orderSelfNum);
distributionStockArticleEntity.setWaybillNumber(waybillNoNum); distributionStockArticleEntity.setWaybillNumber(waybillNoNum);
distributionStockArticleEntity.setWarehouse(basicdataWarehouseEntity.getName());
distributionStockArticleEntity.setWarehouseId(warehouseId);
// 其实是客户 // 其实是客户
distributionStockArticleEntity.setMallName(takeCompany); distributionStockArticleEntity.setMallName(takeCompany);
@ -482,10 +491,6 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
if(ObjectUtils.isNotNull(t)){ if(ObjectUtils.isNotNull(t)){
distributionStockArticleEntity.setAcceptWarehouseName(t.getName()); distributionStockArticleEntity.setAcceptWarehouseName(t.getName());
distributionStockArticleEntity.setAcceptWarehouseId(t.getId()); 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) { public TrayEntity getTrayById(Integer trayId) {
return trayService.getTrayById(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.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.logpm.oldproject.entity.TrayEntity; import com.logpm.oldproject.entity.TrayEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper @Mapper
public interface TrayMapper extends BaseMapper<TrayEntity> { 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"> <!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"> <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> </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 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) { public TrayEntity getTrayById(Integer trayId) {
return trayMapper.selectById(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 lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@Data @Data
public class TrayInfoDTO implements Serializable { public class TrayInfoDTO implements Serializable {
@ -12,4 +14,6 @@ public class TrayInfoDTO implements Serializable {
private String orderPackageCode; private String orderPackageCode;
private Integer type; 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 syncTaskData(String questNum, Long warehouseId);
void sendTrayInfoByOrderPackageCode(TrayInfoDTO trayInfoDTO); 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) { private void dealWithStockTray(String materialCode, String marketName, String incomingBatch, Integer stockNum, String trayCode, String trayType, Long warehouseId) {
log.info("#############dealWithStockTray: 处理库存品的打托"); log.info("#############dealWithStockTray: 处理库存品的打托");

Loading…
Cancel
Save