Browse Source

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

training
pref_mail@163.com 2 years ago
parent
commit
937ec6d9eb
  1. 12
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java
  2. 23
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppReservationVO.java
  3. 17
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java
  4. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java
  5. 57
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml
  6. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java
  7. 9
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  8. 863
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  9. 28
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

12
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscanEntity.java

@ -335,4 +335,16 @@ public class DistributionLoadscanEntity extends TenantEntity {
*/
@ApiModelProperty(value = "签收人Id")
private Long signingUserId;
/**
* 是否异常签收 1- 2-
*/
@ApiModelProperty(value = "是否异常签收 1-否 2-是")
private Long isAbnormalSigning;
/**
* 是否异常装车 1- 2-
*/
@ApiModelProperty(value = "是否异常装车 1-否 2-是")
private Long isAbnormalLoading;
}

23
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppReservationVO.java

@ -74,6 +74,29 @@ public class DistributionAppReservationVO extends DistributionReservationEntity
@ApiModelProperty(value = "备货地址")
private String stockupArea;
/**
* 托盘数量
*/
@ApiModelProperty(value = "托盘数量")
private Integer trayNum;
/**
* 托盘ID
*/
@ApiModelProperty(value = "托盘ID")
private Long trayId;
/**
* 托盘码
*/
@ApiModelProperty(value = "托盘码")
private String trayCode;
/**
* 货物名称
*/
@ApiModelProperty(value = "货物名称")
private String goodsNames;

17
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java

@ -69,6 +69,17 @@ public class DistributionDeliveryAppController {
return R.data(pages);
}
/**
* 配送 查看托盘详情
*/
@GetMapping("/trays")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO")
public R<IPage<DistributionAppReservationVO>> traysDetail(DistributionAppDeliveryListDTO distributionDeliveryList, Query query) {
IPage<DistributionAppReservationVO> pages = distributionDeliveryListService.getAppDeliveryreservationTraysPage(Condition.getPage(query),distributionDeliveryList);
return R.data(pages);
}
/**
* 配送 查看订单
*/
@ -120,8 +131,8 @@ public class DistributionDeliveryAppController {
@PostMapping("/loadingscan")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public Resp loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
Resp msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
public R loadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = distributionDeliveryListService.loadingscan(distrilbutionloadingscanDTO);
return msg;
}
@ -218,7 +229,7 @@ public class DistributionDeliveryAppController {
/**
* 装车补打二维码
* 装车补打库存品二维码
*/
@PostMapping("/patchworkInventoryCode")
@ApiOperationSupport(order = 6)

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java

@ -130,7 +130,7 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper<DistributionD
*
* @return
*/
List<DistributionAppReservationVO> selectAppcustomListPage(IPage<DistributionAppReservationVO> page, Long id);
List<DistributionAppReservationVO> selectAppcustomListPage(IPage<DistributionAppReservationVO> page,@Param("deliveryListId") Long id);
/**
* App-通过配送查询客户库存品信息分页
*
@ -151,4 +151,12 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper<DistributionD
List<DistributionAppStockArticleVO> selectDistributionAppDeliveryOrderCompmletePage(IPage<DistributionAppStockArticleVO> page,@Param("param") DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
List<DistributionAppStockArticleVO> selectDistributionAppDeliveryOrderCompcletePage(IPage<DistributionAppStockArticleVO> page,@Param("param") DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/**
* 查询托盘列表
* @param page
* @param id
* @return
*/
List<DistributionAppReservationVO> selectAppTarysListPage(IPage<DistributionAppReservationVO> page,@Param("reservationId") Long id);
}

57
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.xml

@ -329,15 +329,37 @@
</where>
</select>
<select id="selectAppcustomListPage" resultType="com.logpm.distribution.vo.app.DistributionAppReservationVO">
SELECT DISTINCT ldr.id id, ldr.consignee consignee, ldr.reservation_num reservationNum, COALESCE(lds.loaded_number + lds.loadedin_number, 0) loadingNub,
(SELECT COALESCE(COUNT(*), 0) from logpm_distribution_reservation_stockarticle ldrs WHERE ldrs.reservation_id =ldr.id and ldrs.stock_article_status in (1,3) ) ordNub,
COALESCE(lds.received_quantity + lds.receivedin_quantity, 0) signNub, ldsk.stockup_area stockupArea,COALESCE(ldrs.reservation_num , 0) inventoryNub
FROM logpm_distribution_signfor lds
LEFT JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id and ldr.reservation_status != '40'
LEFT JOIN logpm_distribution_stockup_info ldsi on ldr.id = ldsi.reservation_id
LEFT JOIN logpm_distribution_stockup ldsk on ldsk.id = ldsi.stockup_id
LEFT JOIN logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.stock_list_status in (1,3)
WHERE lds.is_deleted = 0 AND lds.delivery_id = #{id}
SELECT DISTINCT
ldr.id id,
ldr.consignee consignee,
ldr.reservation_num reservationNum,
COALESCE ( lds.loaded_number + lds.loadedin_number, 0 ) loadingNub,
(
SELECT COALESCE
( COUNT(*), 0 )
FROM
logpm_distribution_reservation_stockarticle ldrs
WHERE
ldrs.reservation_id = ldr.id
AND ldrs.stock_article_status IN ( 1, 3 )
) ordNub,
COALESCE ( lds.received_quantity + lds.receivedin_quantity, 0 ) signNub,
ldsk.stockup_area stockupArea,
COALESCE ( ldrs.reservation_num, 0 ) inventoryNub,
COUNT(DISTINCT lwtg.tray_id) AS trayNum
FROM
logpm_distribution_signfor lds
LEFT JOIN logpm_distribution_reservation ldr ON ldr.id = lds.reservation_id
AND ldr.reservation_status != '40'
LEFT JOIN logpm_distribution_stockup_info ldsi ON ldr.id = ldsi.reservation_id
LEFT JOIN logpm_distribution_stockup ldsk ON ldsk.id = ldsi.stockup_id
LEFT JOIN logpm_distribution_reservation_stocklist ldrs ON ldrs.reservation_id = ldr.id
AND ldrs.stock_list_status IN ( 1, 3 )
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON lds.reservation_id = ldrp.reservation_id
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.association_id = ldrp.parce_list_id AND lwtg.association_type = 3
WHERE
lds.delivery_id = #{deliveryListId}
GROUP BY ldr.id,lds.loaded_number,lds.loadedin_number,lds.received_quantity,lds.receivedin_quantity,ldsk.stockup_area,ldrs.reservation_num
</select>
<select id="selectDistributionAppDeliveryInventoryPage"
resultType="com.logpm.distribution.vo.app.DistributionAppStockArticleVO">
@ -472,4 +494,21 @@
AND loading.loadingNub >=ldrs.reservation_num AND ldr.id = #{param.reservationId}
</where>
</select>
<select id="selectAppTarysListPage"
resultType="com.logpm.distribution.vo.app.DistributionAppReservationVO">
SELECT
lwtg.tray_id AS trayId,
lds.reservation_id AS Id,
lwtg.tray_code AS trayCode,
COUNT(lwtga.num) AS trayNum,
GROUP_CONCAT(lwtga.goods_name) AS goodsNames
FROM
logpm_distribution_signfor AS lds
LEFT JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id
LEFT JOIN logpm_warehouse_tray_goods AS lwtg ON lwtg.association_id = ldrp.parce_list_id
JOIN logpm_warehouse_tray_goods AS lwtga ON lwtg.id = lwtga.id
WHERE lds.reservation_id = #{reservationId}
GROUP BY lwtg.tray_id,lds.reservation_id,lwtg.tray_code,lwtg.num
</select>
</mapper>

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

@ -96,7 +96,7 @@ public interface DistributionParcelListMapper extends BaseMapper<DistributionPar
List<PackageStockupVO> selectOrderInfoAllocationList(@Param("param") StockupDTO stockupDTO);
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("orderCode") Long warehouseId);
List<DistributionParcelListEntity> findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("warehouseId") Long warehouseId);
IPage<DistributionParcelListEntity> pageOweList(IPage<Object> page,@Param("param") DistributionParcelListDTO parcelListEntity);

9
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java

@ -87,7 +87,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
/**
*App-装车扫描
*/
Resp loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
*App-装车确认
*/
@ -250,4 +250,11 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
List<PrintPreviewVO> printBatchByReservation(String ids);
/**
* 查询托盘详情
* @param page
* @param distributionDeliveryList
* @return
*/
IPage<DistributionAppReservationVO> getAppDeliveryreservationTraysPage(IPage<DistributionAppReservationVO> page, DistributionAppDeliveryListDTO distributionDeliveryList);
}

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

@ -45,7 +45,11 @@ import com.logpm.distribution.wrapper.DistributionDeliveryListWrapper;
import com.logpm.distribution.wrapper.DistributionParcelListWrapper;
import com.logpm.distribution.wrapper.DistributionReservationWrapper;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import com.logpm.warehouse.entity.WarehouseTrayTypeEntity;
import com.logpm.warehouse.feign.IWarehouseTrayTypeClient;
import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient;
import com.logpm.warehouse.vo.TrayTypeDataVO;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
@ -90,6 +94,7 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@ -138,6 +143,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final DistributionStockListMapper distributionStockListMapper;
private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
private final IWarehouseTrayTypeClient warehouseTrayTypeClient;
@Override
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) {
@ -397,8 +403,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
// synchronized
public Resp loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
// -----------------------------------2023-09-25 签收调整----------------------------------------------------------------
// 首先这里需要查看该包件是否属于该配送任务
// 属于该配送任务需要进行是否属于该客户进行判断
// 如果属于该客户则进行装车扫描
//
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
//异步确认包条扫描信息
@ -412,130 +422,551 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity);
}
if (distrilbutionloadingscanDTO.getType() == 1) {
// if (distrilbutionloadingscanDTO.getStockType() == 1) {
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() <= 0) {
return Resp.scanSuccess("窜货", "窜货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//查询是否重复扫码
if (distrilbutionloadingscanDTO.getType() == 1){
List<DistributionParcelListEntity> distributionParcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListEntities.stream().filter(p -> Func.equals(p.getOrderPackageCode(), distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
if (parcelListEntityList.size() == 1){
//在配送任务中存在该包件的计划
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (!distributionLoadscanEntitiesflag.isEmpty()) {
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
if (Func.isNotEmpty(distributionLoadscanEntitiesflag) && distributionLoadscanEntitiesflag.size() == 1){
return Resp.scanSuccess("重复扫码", "重复扫码");
}
//依次插入该装车记录,设置车辆
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())){
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
//添加车次号
distributionLoadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscanEntity.setScanType("1");
distributionLoadscanEntity.setScanTime(new Date());
BladeUser user = AuthUtil.getUser();
distributionLoadscanEntity.setScanUser(user.getNickName());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())){
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())){
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())){
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
//distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.);
//依次更新该装车记录,设置车辆
// distributionLoadscanMapper.updateSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
// distributionLoadscanordMapper.updateSumById(distributionLoadscanEntity.getOrderId(),distrilbutionloadingscanDTO);
// distributionLoadscanresMapper.updateSumById(distributionLoadscanEntity.getReservationId(),distrilbutionloadingscanDTO);
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())){
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
DistributionParcelListEntity parcelListEntity = parcelListEntityList.get(0);
//添加车次号
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
loadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
loadscanEntity.setScanType("1");
loadscanEntity.setOneClick(1);
loadscanEntity.setPackageId(parcelListEntity.getId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
loadscanEntity.setScanTime(new Date());
BladeUser user = AuthUtil.getUser();
loadscanEntity.setScanUser(user.getUserName());
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
//出库
warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode());
distributionLoadscanService.save(loadscanEntity);
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
//判断是商配还是市配
// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
// if (distributionDeliveryListEntity.getType().equals("1")) {
// //判断签收表有无客户信息,没有就加入信息
// Long c = distributionSignforMapper.selectCount(new QueryWrapper<DistributionSignforEntity>().lambda()
// .eq(DistributionSignforEntity::getDeliveryType,"1")
// .eq(DistributionSignforEntity::getReservationId,distributionLoadscanEntity.getReservationId())
// );
// //冗余加入
// if (c<=0){
// DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionLoadscanEntity.getReservationId());
// DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
// BeanUtils.copyProperties(distributionReservationEntity,distributionSignforEntity);
// distributionSignforEntity.setReservationId(distributionReservationEntity.getId());
// //设置车次
// distributionSignforEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
// distributionSignforEntity.setDeliveryType(distributionDeliveryListEntity.getType());
// distributionSignforEntity.setId(null);
// distributionSignforEntity.setLoadingTime(distributionDeliveryListEntity.getLoadingTime());
// distributionSignforEntity.setDeliveryDriverName(distributionDeliveryListEntity.getDriverName());
// distributionSignforEntity.setSigningStatus("1");
// distributionSignforEntity.setDriverSigning("1");
// distributionSignforMapper.insert(distributionSignforEntity);
// }
// }
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//这里还需要一个维护状态的方法
}else if (parcelListEntityList.size() == 0){
//查找出该包件信息
DistributionParcelListEntity parcelListEntity = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
List<DistributionReservationEntity> reservationEntityList = distributionDeliveryListMapper.selectReservationByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
boolean shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shipie.getValue()));
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleMapper.selectById(parcelListEntity.getStockArticleId());
if (shangpeiFlag){
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee())
&& r.getConsignee().equals(stockArticleEntity.getCustomerName())
&& r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress())
&& r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone())
&& r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
//查看是否存在满足条件的预约单
if (reservationEntities.size() == 1){
return R.fail(5000,"异常装车");
// return Resp.scanFail("装车失败","程序出错,请联系张思雨");
}else {
return Resp.scanFail("装车失败","窜货");
}
}else {
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
if (shangpeiFlag){
List<DistributionReservationEntity> reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r) && r.getConsignee().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList());
if (reservationEntities.size() == 1){
return R.fail(5000,"异常装车");
}else {
return Resp.scanFail("装车失败","窜货");
}
}else {
log.error("配送计划预约类型错误:{}",reservationEntityList);
}
}
//不存在配送计划中,这里进行客户的判断
}
}else if (distrilbutionloadingscanDTO.getType() ==2){
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(distrilbutionloadingscanDTO.getBarcode());
if (Func.isNotEmpty(trayTypeDataVO)){
List<WarehouseTrayGoodsEntity> voGoodsLsit = trayTypeDataVO.getGoodsLsit();
List<Long> trayGoodIds = voGoodsLsit.stream().filter(v -> v.getAssociationType().equals("3")).map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList());
//此时经过过滤后的包件ID和托盘上的所有包件ID数量一致,视为该托盘上的均为包件
if (voGoodsLsit.size() == trayGoodIds.size()){
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.listByIds(trayGoodIds);
boolean trayLoadingStatus = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue()));
if (trayLoadingStatus){
return Resp.scanFail("托盘装车完毕","托盘装车完毕");
}
if (Func.isEmpty(parcelListEntities) || parcelListEntities.size() <= 0){
return Resp.scanFail("操作失败","该托盘上无货物信息");
}
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())){
//存在客户 这里就是针对客户进行的整托装车
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
Map<Long, DistributionParcelListEntity> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2));
boolean reservationFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(parcelListEntityMap.get(p.getId())));
if (reservationFlag){
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())){
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())){
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())){
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())){
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())){
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setScanTime(new Date());
BladeUser user = AuthUtil.getUser();
loadscanEntity.setScanUser(user.getUserName());
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
loadscanEntity.setOneClick(1);
loadscanEntity.setScanType("2");
loadscanEntity.setScanStatus("2");
loadscanEntity.setIsInsert(1);
loadscanEntity.setMsg("司机按照预约整托装车");
loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode());
reservationLoadscanEntities.add(loadscanEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
}
//TODO 需要一个维护状态的异步方法
}
distributionLoadscanService.saveBatch(reservationLoadscanEntities);
//这里则进行整托装车的数据构建
}else {
return Resp.scanFail("整托装车失败","存在其他客户货物");
}
}else {
//不存在客户 这里就是针对配送任务进行的整托装车
List<DistributionParcelListEntity> deliveryPackageList = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
Map<Long, DistributionParcelListEntity> deliveryPackageMap = deliveryPackageList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2));
boolean delivaryFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(deliveryPackageMap.get(p.getId())));
if (delivaryFlag){
List<DistributionLoadscanEntity> deliveryLoadscanEntities = new ArrayList<>();
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) {
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())){
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
distributionParcelListService.updateById(parcelListEntity);
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity();
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())){
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())){
loadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())){
loadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())){
loadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())){
loadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
loadscanEntity.setOrderId(parcelListEntity.getStockArticleId());
loadscanEntity.setOrderPackageCode(parcelListEntity.getOrderPackageCode());
loadscanEntity.setReservationId(distrilbutionloadingscanDTO.getReservationId());
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
loadscanEntity.setPackageNub(parcelListEntity.getQuantity());
loadscanEntity.setScanTime(new Date());
BladeUser user = AuthUtil.getUser();
loadscanEntity.setScanUser(user.getUserName());
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
loadscanEntity.setOneClick(1);
loadscanEntity.setScanType("2");
loadscanEntity.setScanStatus("2");
loadscanEntity.setIsInsert(1);
loadscanEntity.setMsg("司机按照计划整托装车");
loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode());
deliveryLoadscanEntities.add(loadscanEntity);
//更新装车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
}
//TODO 需要一个维护状态的异步方法
}
distributionLoadscanService.saveBatch(deliveryLoadscanEntities);
//这里则进行整托装车的数据构建
}else {
return Resp.scanFail("整托装车失败","存在其他客户货物");
}
}
}else {
log.error("托盘存放货物类型不单一:{}",trayTypeDataVO);
}
}
warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode());
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// //找出该包条码
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper<DistributionParcelListEntity>().lambda()
// .eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
// for (DistributionParcelListEntity e : distributionParcelListEntities) {
// String trainNumber = distributionLoadscanMapper.selecttrainNumberByPackageId(e.getId());
// if (!trainNumber.equals(distributionDeliveryListEntities.get(0).getTrainNumber())) {
// return R.fail(3002, "不是当前司机配送车次");
}
return Resp.scanSuccess("装车成功", "装车成功");
}
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
// if (distrilbutionloadingscanDTO.getType() == 1) {
// // if (distrilbutionloadingscanDTO.getStockType() == 1) {
// //查询该包条是否属于该配送任务
// List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// if (distributionLoadscanEntities.size() <= 0) {
//
// return Resp.scanSuccess("窜货", "窜货");
// }
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (!distributionLoadscanEntitiesflag.isEmpty()) {
// return Resp.scanSuccess("重复扫码", "重复扫码");
// }
// if (Func.notNull(bladeRedis.get("ZC" + user.getUserId()))) {
// if (!(bladeRedis.get("ZC" + user.getUserId().toString()).equals(trainNumber))) {
// return R.fail(3003, "串货");
// }
// } else {
// //第一次缓存
// bladeRedis.setEx("ZC" + user.getUserId(), trainNumber, 3600L);
// //TODO 查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntities.get(0).getId());
// //查询该车次包条,加入签收表
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// //添加车次号
// distributionLoadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setScanTime(new Date());
// BladeUser user = AuthUtil.getUser();
// distributionLoadscanEntity.setScanUser(user.getNickName());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// //distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.);
// //依次更新该装车记录,设置车辆
// // distributionLoadscanMapper.updateSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
//// distributionLoadscanordMapper.updateSumById(distributionLoadscanEntity.getOrderId(),distrilbutionloadingscanDTO);
//// distributionLoadscanresMapper.updateSumById(distributionLoadscanEntity.getReservationId(),distrilbutionloadingscanDTO);
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// //判断是商配还是市配
//// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
//// if (distributionDeliveryListEntity.getType().equals("1")) {
//// //判断签收表有无客户信息,没有就加入信息
//// Long c = distributionSignforMapper.selectCount(new QueryWrapper<DistributionSignforEntity>().lambda()
//// .eq(DistributionSignforEntity::getDeliveryType,"1")
//// .eq(DistributionSignforEntity::getReservationId,distributionLoadscanEntity.getReservationId())
//// );
//// //冗余加入
//// if (c<=0){
//// DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionLoadscanEntity.getReservationId());
//// DistributionSignforEntity distributionSignforEntity = new DistributionSignforEntity();
//// BeanUtils.copyProperties(distributionReservationEntity,distributionSignforEntity);
//// distributionSignforEntity.setReservationId(distributionReservationEntity.getId());
//// //设置车次
//// distributionSignforEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber());
//// distributionSignforEntity.setDeliveryType(distributionDeliveryListEntity.getType());
//// distributionSignforEntity.setId(null);
//// distributionSignforEntity.setLoadingTime(distributionDeliveryListEntity.getLoadingTime());
//// distributionSignforEntity.setDeliveryDriverName(distributionDeliveryListEntity.getDriverName());
//// distributionSignforEntity.setSigningStatus("1");
//// distributionSignforEntity.setDriverSigning("1");
//// distributionSignforMapper.insert(distributionSignforEntity);
//// }
// // }
// }
//
//// //找出该包条码
//// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper<DistributionParcelListEntity>().lambda()
//// .eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()));
//// for (DistributionParcelListEntity e : distributionParcelListEntities) {
//// String trainNumber = distributionLoadscanMapper.selecttrainNumberByPackageId(e.getId());
//// if (!trainNumber.equals(distributionDeliveryListEntities.get(0).getTrainNumber())) {
//// return R.fail(3002, "不是当前司机配送车次");
//// }
//// if (Func.notNull(bladeRedis.get("ZC" + user.getUserId()))) {
//// if (!(bladeRedis.get("ZC" + user.getUserId().toString()).equals(trainNumber))) {
//// return R.fail(3003, "串货");
//// }
//// } else {
//// //第一次缓存
//// bladeRedis.setEx("ZC" + user.getUserId(), trainNumber, 3600L);
//// //TODO 查询本车次是否第一次扫码,没有则更新上车时间
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntities.get(0).getId());
//// //查询该车次包条,加入签收表
////
////
//// //修改对应的装车表
////
//// distributionLoadscanMapper.updateByPackageId(e.getId());
//// }
//// }
//// } else if (distrilbutionloadingscanDTO.getStockType() == 2) {
//// //库存品
//// //查询该包条是否属于该配送任务
//// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVn(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
//// if (distributionLoadscanvnEntities.size() <= 0) {
//// return R.fail(3001, "窜货");
//// }
//// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
//// //查询是否重复扫码
//// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
//// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
//// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
//// .ne(DistributionLoadscanEntity::getScanStatus, 1)
//// );
//// if (distributionLoadscanEntitiesflag.size() > 0) {
//// return R.fail(3002, "重复扫码");
//// }
//// //依次插入该装车记录,设置车辆
//// if (null != distributionDeliverySelfEntity.getDriverId()) {
//// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
//// }
//// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
//// distributionLoadscanEntity.setScanStatus(2);
//// distributionLoadscanEntity.setScanType("1");
//// distributionLoadscanEntity.setScanTime(new Date());
//// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
//// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
//// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
//// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
//// }
//// if (null != distributionDeliverySelfEntity.getVehicleId()) {
//// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
//// }
//// //distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.);
//// //依次更新该装车记录,设置车辆
//// // distributionLoadscanMapper.updateSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
////// distributionLoadscanordMapper.updateSumById(distributionLoadscanEntity.getOrderId(),distrilbutionloadingscanDTO);
////// distributionLoadscanresMapper.updateSumById(distributionLoadscanEntity.getReservationId(),distrilbutionloadingscanDTO);
//// //查询本车次是否第一次扫码,没有则更新上车时间
//// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//// //更新签收表的装车数量
//// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), 1);
////
//// }
//// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
////
//// }
// } else if (distrilbutionloadingscanDTO.getType() == 2) {
// //TODO 托盘扫描
// //查询出该托盘下的所有货物
// List<DistributionLoadscanEntity> parcelListEntityList = baseMapper.selectTrayPackageList(distrilbutionloadingscanDTO.getBarcode());
// //查询出配送任务下的所有包件信息
// Map<Long, List<DistributionLoadscanEntity>> trayPackage = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId));
//
//
// //修改对应的装车表
// //查询该包条是否属于该配送任务
// List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverypallet(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// Map<Long, List<DistributionLoadscanEntity>> deliveryPackage = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId));
// Iterator<Map.Entry<Long, List<DistributionLoadscanEntity>>> iterator = trayPackage.entrySet().iterator();
// while (iterator.hasNext()) {
// Map.Entry<Long, List<DistributionLoadscanEntity>> entry = iterator.next();
// Long key = entry.getKey();
// List<DistributionLoadscanEntity> loadscanEntities = deliveryPackage.get(key);
// if (Func.isEmpty(deliveryPackage.get(entry.getKey()))) {
// //todo 未完成代码
// }
//
// distributionLoadscanMapper.updateByPackageId(e.getId());
// }
//// trayPackage.forEach((k,v)->{
//// //这里就是托盘出现了配送任务中没有的包件
//// if (Func.isEmpty(deliveryPackage.get(k))){
//// return Resp.scanSuccess("串货", "串货");
//// }
//// });
//
//
// if (distributionLoadscanEntities.size() <= 0) {
// return Resp.scanSuccess("串货", "串货");
// }
// //库存品
//
// //查询该包条是否属于该配送任务
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVn(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// if (distributionLoadscanvnEntities.size() <= 0) {
// return Resp.scanSuccess("串货", "串货");
// }
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (!distributionLoadscanEntitiesflag.isEmpty()) {
// return Resp.scanSuccess("有扫描过的货物", "有扫描过的货物");
// }
// if (!Objects.equals(distributionLoadscanEntity.getDeliveryId(), distrilbutionloadingscanDTO.getDeliveryId())) {
// return Resp.scanSuccess("有其他车次货物", "有其他车次货物");
// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanType("2");
// distributionLoadscanEntity.setScanTime(new Date());
// distributionLoadscanEntity.setTrayNo(distributionLoadscanEntity.getOrderPackageCode());
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
//
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (!distributionLoadscanEntitiesflag.isEmpty()) {
// return Resp.scanSuccess("重复扫描", "重复扫描");
// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setScanTime(new Date());
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), 1);
// }
// } else if (distrilbutionloadingscanDTO.getStockType() == 2) {
// //库存品
// //查询该包条是否属于该配送任务
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVn(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// if (distributionLoadscanvnEntities.size() <= 0) {
// return R.fail(3001, "窜货");
// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
// } else if (distrilbutionloadingscanDTO.getType() == 3) {
// //订单扫描,查询该订单是否有数据
// DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(
// new QueryWrapper<DistributionReservationStockarticleEntity>().lambda()
// .eq(DistributionReservationStockarticleEntity::getStockArticleId, distrilbutionloadingscanDTO.getBarcode()));
// if (distributionReservationStockarticleEntity.getIsHaveData() == 1) {
// //查询订单是否属于该配送任务
// List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectOrderpallet(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (!distributionLoadscanEntitiesflag.isEmpty()) {
// return Resp.scanSuccess("重复扫描", "重复扫描");
// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanType("3");
// distributionLoadscanEntity.setScanTime(new Date());
// distributionLoadscanEntity.setScanState(1);
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// } else {
// //查询订单是否属于该配送任务
// List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectOrderStrip(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
// //查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (distributionLoadscanEntitiesflag.size() > 0) {
// return R.fail(3002, "重复扫码");
// if (!distributionLoadscanEntitiesflag.isEmpty()) {
// return Resp.scanSuccess("重复扫描", "重复扫描");
// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
// distributionLoadscanEntity.setDriverId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(2);
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
// distributionLoadscanEntity.setScanTime(new Date());
// distributionLoadscanEntity.setScanType("3");
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
@ -544,225 +975,32 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.);
// //依次更新该装车记录,设置车辆
// // distributionLoadscanMapper.updateSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
//// distributionLoadscanordMapper.updateSumById(distributionLoadscanEntity.getOrderId(),distrilbutionloadingscanDTO);
//// distributionLoadscanresMapper.updateSumById(distributionLoadscanEntity.getReservationId(),distrilbutionloadingscanDTO);
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(), 1);
//
// Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
//
// distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// }
} else if (distrilbutionloadingscanDTO.getType() == 2) {
//TODO 托盘扫描
//查询出该托盘下的所有货物
List<DistributionLoadscanEntity> parcelListEntityList = baseMapper.selectTrayPackageList(distrilbutionloadingscanDTO.getBarcode());
//查询出配送任务下的所有包件信息
Map<Long, List<DistributionLoadscanEntity>> trayPackage = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId));
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverypallet(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
Map<Long, List<DistributionLoadscanEntity>> deliveryPackage = distributionLoadscanEntities.stream().collect(Collectors.groupingBy(DistributionLoadscanEntity::getPackageId));
Iterator<Map.Entry<Long, List<DistributionLoadscanEntity>>> iterator = trayPackage.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Long, List<DistributionLoadscanEntity>> entry = iterator.next();
Long key = entry.getKey();
List<DistributionLoadscanEntity> loadscanEntities = deliveryPackage.get(key);
if (Func.isEmpty(deliveryPackage.get(entry.getKey()))) {
//todo 未完成代码
}
}
// trayPackage.forEach((k,v)->{
// //这里就是托盘出现了配送任务中没有的包件
// if (Func.isEmpty(deliveryPackage.get(k))){
// return Resp.scanSuccess("串货", "串货");
// }
// });
if (distributionLoadscanEntities.size() <= 0) {
return Resp.scanSuccess("串货", "串货");
}
//库存品
//查询该包条是否属于该配送任务
List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVn(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanvnEntities.size() <= 0) {
return Resp.scanSuccess("串货", "串货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("有扫描过的货物", "有扫描过的货物");
}
if (!Objects.equals(distributionLoadscanEntity.getDeliveryId(), distrilbutionloadingscanDTO.getDeliveryId())) {
return Resp.scanSuccess("有其他车次货物", "有其他车次货物");
}
//依次插入该装车记录,设置车辆
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscanEntity.setScanType("2");
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setTrayNo(distributionLoadscanEntity.getOrderPackageCode());
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫描", "重复扫描");
}
//依次插入该装车记录,设置车辆
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscanEntity.setScanType("1");
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), 1);
}
distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
} else if (distrilbutionloadingscanDTO.getType() == 3) {
//订单扫描,查询该订单是否有数据
DistributionReservationStockarticleEntity distributionReservationStockarticleEntity = distributionReservationStockarticleMapper.selectOne(
new QueryWrapper<DistributionReservationStockarticleEntity>().lambda()
.eq(DistributionReservationStockarticleEntity::getStockArticleId, distrilbutionloadingscanDTO.getBarcode()));
if (distributionReservationStockarticleEntity.getIsHaveData() == 1) {
//查询订单是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectOrderpallet(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫描", "重复扫描");
}
//依次插入该装车记录,设置车辆
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscanEntity.setScanType("3");
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setScanState(1);
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
} else {
//查询订单是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectOrderStrip(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getDeliveryId())
.eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
.ne(DistributionLoadscanEntity::getScanStatus, 1)
);
if (!distributionLoadscanEntitiesflag.isEmpty()) {
return Resp.scanSuccess("重复扫描", "重复扫描");
}
//依次插入该装车记录,设置车辆
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
distributionLoadscanEntity.setDriverId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.saomiao.getValue());
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setScanType("3");
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
}
}
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
// distributionAsyncService.changeOrderStatus(distrilbutionloadingscanDTO.getBarcode(),deliveryId);
//修改配送任务状态
String barcode = distrilbutionloadingscanDTO.getBarcode();
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.<DistributionDeliveryListEntity>query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId));
//判断配送计划是否需要进行库存品状态的变更
if (deliveryListEntity.getType().equals(DistributionTypeConstant.shangpei.getValue())) {
distributionAsyncService.changeDiscussDeliveryListStatus(barcode, deliveryId);
} else if (deliveryListEntity.getType().equals(DistributionTypeConstant.shipie.getValue())) {
//需要判断是否依据库存品进行变更
distributionAsyncService.changeMarketDeliveryListStatus(barcode, deliveryId);
}
// }
// Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
//// distributionAsyncService.changeOrderStatus(distrilbutionloadingscanDTO.getBarcode(),deliveryId);
// //修改配送任务状态
// String barcode = distrilbutionloadingscanDTO.getBarcode();
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListMapper.selectOne(Wrappers.<DistributionDeliveryListEntity>query().lambda().eq(DistributionDeliveryListEntity::getId, deliveryId));
// //判断配送计划是否需要进行库存品状态的变更
// if (deliveryListEntity.getType().equals(DistributionTypeConstant.shangpei.getValue())) {
// distributionAsyncService.changeDiscussDeliveryListStatus(barcode, deliveryId);
// } else if (deliveryListEntity.getType().equals(DistributionTypeConstant.shipie.getValue())) {
// //需要判断是否依据库存品进行变更
// distributionAsyncService.changeMarketDeliveryListStatus(barcode, deliveryId);
//
//
// }
// this.changeDeliveryListStatuss(distrilbutionloadingscanDTO.getBarcode(), deliveryId);
return Resp.scanSuccess("成功", "成功");
}
// return Resp.scanSuccess("成功", "成功");
// }
@Transactional(isolation = Isolation.READ_UNCOMMITTED, rollbackFor = Exception.class)
public void changeDeliveryListStatuss(String barcode, Long deliveryId) {
@ -3305,6 +3543,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return list;
}
@Override
public IPage<DistributionAppReservationVO> getAppDeliveryreservationTraysPage(IPage<DistributionAppReservationVO> page, DistributionAppDeliveryListDTO distributionDeliveryList) {
// ---------------------------------2023-09-25 新增托盘详情---------------------------------------------------------------------------------------
List<DistributionAppReservationVO> customList = distributionDeliveryInfoMapper.selectAppTarysListPage(page, Long.parseLong(distributionDeliveryList.getReservationId()));
return page.setRecords(customList);
}
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) {
Map<String, String> map = new HashMap<>();
String dirverName = null;

28
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -1881,23 +1881,29 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
targetUpdownTypeEntity.setShelfTitle(goodsShelfEntity.getGoodsShelfName());
targetUpdownTypeEntity.setAllocationId(allocationId);
targetUpdownTypeEntity.setAllocationTitle(goodsAllocationEntity.getGoodsAllocationName());
targetUpdownTypeEntity.setPositionCode(goodsAreaEntity.getHeadline()+"-"+goodsShelfEntity.getGoodsShelfName()+"-"+goodsAllocationEntity.getGoodsAllocationName());
save(targetUpdownTypeEntity);
for(WarehouseUpdownGoodsEntity updownGoodsEntity:list){
updownGoodsEntity.setAreaId(goodsAreaId);
updownGoodsEntity.setAreaTitle(goodsAreaEntity.getHeadline());
updownGoodsEntity.setShelfId(goodsShelfId);
updownGoodsEntity.setShelfTitle(goodsShelfEntity.getGoodsShelfName());
updownGoodsEntity.setAllocationId(allocationId);
updownGoodsEntity.setAllocationTitle(goodsAllocationEntity.getGoodsAllocationName());
updownGoodsEntity.setPositionCode(goodsAreaEntity.getHeadline()+"-"+goodsShelfEntity.getGoodsShelfName()+"-"+goodsAllocationEntity.getGoodsAllocationName());
List<WarehouseUpdownGoodsEntity> newList = new ArrayList<>();
for(WarehouseUpdownGoodsEntity updownGoodsEntity:list){
WarehouseUpdownGoodsEntity newUpdownGoods = new WarehouseUpdownGoodsEntity();
BeanUtil.copy(updownGoodsEntity,newUpdownGoods);
newUpdownGoods.setId(null);
newUpdownGoods.setUpdownTypeId(targetUpdownTypeEntity.getId());
newUpdownGoods.setAreaId(goodsAreaId);
newUpdownGoods.setAreaTitle(goodsAreaEntity.getHeadline());
newUpdownGoods.setShelfId(goodsShelfId);
newUpdownGoods.setShelfTitle(goodsShelfEntity.getGoodsShelfName());
newUpdownGoods.setAllocationId(allocationId);
newUpdownGoods.setAllocationTitle(goodsAllocationEntity.getGoodsAllocationName());
newUpdownGoods.setPositionCode(goodsAreaEntity.getHeadline()+"-"+goodsShelfEntity.getGoodsShelfName()+"-"+goodsAllocationEntity.getGoodsAllocationName());
newList.add(newUpdownGoods);
}
//货物重新绑定
warehouseUpdownGoodsService.saveOrUpdateBatch(list);
warehouseUpdownGoodsService.saveOrUpdateBatch(newList);
saveUpdownGoodsLog(list,"1",0,"移库:整库移库",targetUpdownTypeEntity.getWarehouseId());
saveUpdownGoodsLog(newList,"1",0,"移库:整库移库上架",targetUpdownTypeEntity.getWarehouseId());
}

Loading…
Cancel
Save