Browse Source

1.修改装车扫描

dev-warehouse
0.0 2 years ago
parent
commit
ad52132be5
  1. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  2. 44
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java
  3. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  4. 58
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  5. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml
  6. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  7. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  8. 231
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java

@ -17,6 +17,7 @@
package com.logpm.distribution.controller;
import com.logpm.distribution.dto.DistributionSignforDTO;
import com.logpm.distribution.dto.DistrilbutionloadingscanDTO;
import com.logpm.distribution.service.IDistributionReservationService;
import com.logpm.distribution.vo.DistributionSignforsnmbVO;
import com.logpm.distribution.vo.DistributionstatisticsnmbVO;
@ -119,6 +120,15 @@ public class DistributionSignforController extends BladeController {
IPage<DistributionSignforVO> pages = distributionSignforService.selectDistributionSignforPage(Condition.getPage(query), distributionSignfor);
return R.data(pages);
}
// /**
// * 签收管理 签收
// */
// @GetMapping("/signfor")
// @ApiOperationSupport(order = 2)
// public R signfor(@Valid @RequestBody DistrilbutionsignforDTO distrilbutionloadingscanDTO) {
// R msg = distributionSignforService.signfor(distrilbutionloadingscanDTO);
// return msg;
// }
/**
* 签收管理 新增

44
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionloadingscanDTO.java

@ -47,26 +47,26 @@ public class DistrilbutionloadingscanDTO {
@NotEmpty(message = "车辆信息Id不能为空")
private String loadingId;
/**
*司机姓名
*/
@ApiModelProperty(value = "司机姓名")
@NotEmpty(message = "司机姓名不能为空")
private String driverName;
/**
*司机手机
*/
@ApiModelProperty(value = "司机手机")
@NotEmpty(message = "司机手机不能为空")
private String driverPhone;
// /**
// *司机姓名
// */
// @ApiModelProperty(value = "司机姓名")
// @NotEmpty(message = "司机姓名不能为空")
// private String barcodedriverName;
//
// /**
// *司机手机
// */
// @ApiModelProperty(value = "司机手机")
// @NotEmpty(message = "司机手机不能为空")
// private String driverPhone;
/**
*车牌号
*/
@ApiModelProperty(value = "车牌号")
@NotEmpty(message = "车牌号不能为空")
private String vehicleName;
// /**
// *车牌号
// */
// @ApiModelProperty(value = "车牌号")
// @NotEmpty(message = "车牌号不能为空")
// private String vehicleName;
/**
* 扫描物品
@ -75,6 +75,12 @@ public class DistrilbutionloadingscanDTO {
// @NotEmpty(message = "扫描物品不能为空")
private Integer type;
/**
* 是否库存品
*/
@ApiModelProperty(value = "是否库存品(1-包件,2-库存品)")
// @NotEmpty(message = "扫描物品不能为空")
private Integer stockType;
/**
* 库存品扫描物品

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java

@ -22,6 +22,8 @@ import com.logpm.distribution.dto.DistrilbutionloadingscanDTO;
import com.logpm.distribution.entity.DistributionDeliveryListEntity;
import com.logpm.distribution.vo.DistributionDeliveryListPrintReponseVO;
import com.logpm.distribution.vo.DistributionDeliveryListPrintRequestVO;
import com.logpm.distribution.entity.DistributionLoadscanEntity;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.vo.DistributionDeliveryListVO;
import com.logpm.distribution.excel.DistributionDeliveryListExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -92,5 +94,17 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
*/
Integer updateloadingTimeById(Long id);
/**
* 查询该包条是否属于该配送任务
*
* @return
*/
List<DistributionLoadscanEntity> selectdeliverywork(@Param("barcode")String barcode,@Param("deliveryId") Long deliveryId);
List<DistributionDeliveryListPrintReponseVO> customListPage(IPage<DistributionDeliveryListPrintReponseVO> page, @Param("qw") QueryWrapper<DistributionDeliveryListPrintRequestVO> queryWrapper);
List<DistributionLoadscanEntity> selectdeliverypallet(@Param("barcode")String barcode,@Param("deliveryId") Long deliveryId);
List<DistributionLoadscanEntity> selectOrderpallet(@Param("barcode")String barcode,@Param("deliveryId") Long deliveryId);
}

58
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml

@ -277,6 +277,48 @@
</if>
</where>
</select>
<select id="selectdeliverywork" resultType="com.logpm.distribution.entity.DistributionLoadscanEntity">
SELECT
ldpl.id packageId,
ldrs.id orderId,
ldpl.packet_bar_code packetBarCode,
lds.reservation_id reservationId,
ldpl.quantity packageNub,
ldpl.quantity loadedNub,
lddl.id deliveryId,
lddl.train_number trainNumber
FROM
logpm_distribution_reservation_package ldrp
JOIN logpm_distribution_signfor lds on lds.reservation_id = ldrp.reservation_id
join logpm_distribution_reservation_stockarticle ldrs on lds.reservation_id = ldrs.reservation_id
JOIN logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
where
ldrs.is_have_data = '2' and lds.is_deleted =0 and lddl.id = #{deliveryId} and ldpl.packet_bar_code =#{barcode}
</select>
<select id="selectdeliverypallet" resultType="com.logpm.distribution.entity.DistributionLoadscanEntity">
SELECT
ldpl.id packageId,
ldrs.id orderId,
ldpl.packet_bar_code packetBarCode,
lds.reservation_id reservationId,
ldpl.quantity packageNub,
ldpl.quantity loadedNub,
lddl.id deliveryId,
lddl.train_number trainNumber
FROM
logpm_distribution_reservation_package ldrp
JOIN logpm_distribution_signfor lds on lds.reservation_id = ldrp.reservation_id
join logpm_distribution_reservation_stockarticle ldrs on lds.reservation_id = ldrs.reservation_id
JOIN logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
join logpm_distribution_parcel_list ldpl on ldrp.parce_list_id = ldpl.id
where
ldrs.is_have_data = '2' and lds.is_deleted =0 and lddl.id = #{deliveryId} and ldpl.pallet =#{barcode}
</select>
<select id="customListPage" resultType="com.logpm.distribution.vo.DistributionDeliveryListPrintReponseVO">
@ -303,4 +345,20 @@
lds.delivery_id = #{qw.deliveryId}
</select>
<select id="selectOrderpallet" resultType="com.logpm.distribution.entity.DistributionLoadscanEntity">
SELECT
ldsa.id orderId,
ldsa.stock_article_code packetBarCode,
lds.reservation_id reservationId,
ldsa.total_number packageNub,
ldsa.total_number loadedNub,
lddl.id deliveryId,
lddl.train_number trainNumber
FROM
logpm_distribution_signfor lds
join logpm_distribution_reservation_stockarticle ldrs on lds.reservation_id = ldrs.reservation_id
JOIN logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
join logpm_distribution_stock_article ldsa on ldsa.id = ldrs.stock_article_id
WHERE ldrs.is_have_data = '1' and ldsa.is_deleted =0 and lddl.id = #{deliveryId} and ldsa.id =#{barcode}
</select>
</mapper>

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

@ -156,11 +156,6 @@
UPDATE logpm_distribution_loadscan
<trim prefix="SET" suffixOverrides=",">
scan_status = 1,
loaded_nub =
CASE
WHEN ( loaded_nub - 1 ) &lt; 0 THEN
package_nub ELSE ( loaded_nub - 1 )
END,
<!-- <if test="param.loadingId != null">-->
<!-- loading_id = TRIM(BOTH ',' FROM REPLACE(loading_id, #{param.loadingId}, '')),-->
<!-- </if>-->

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

@ -100,5 +100,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
*/
Long selectIdByOrderId(Long id);
Integer updateloadByReservationId(Long reservationId);
Integer updateloadByReservationId(@Param("reservationId") Long reservationId,@Param("nub") Integer nub);
Integer updateloadreduceByReservationId(@Param("reservationId") Long reservationId,@Param("nub") Integer nub);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml

@ -43,7 +43,10 @@
<result column="delivery_phone" property="deliveryPhone"/>
</resultMap>
<update id="updateloadByReservationId">
UPDATE logpm_distribution_signfor lds set loaded_number = ( loaded_number + 1 ) WHERE lds.is_deleted =0 and lds.reservation_id = #{id}
UPDATE logpm_distribution_signfor lds set loaded_number = ( loaded_number + #{nub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId}
</update>
<update id="updateloadreduceByReservationId">
UPDATE logpm_distribution_signfor lds set loaded_number = ( loaded_number - #{nub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{id} and loaded_number !=0
</update>

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

@ -69,6 +69,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final DistributionReservationMapper distributionReservationMapper;
private final DistributionParcelListMapper distributionParcelListMapper;
private final DistributionLoadscanMapper distributionLoadscanMapper;
private final DistributionLoadscanServiceImpl distributionLoadscanService;
private final DistributionDeliveryListMapper distributionDeliveryListMapper;
private final DistributionSignforServiceImpl distributionSignforService;
private final DistributionSignforMapper distributionSignforMapper;
@ -77,6 +78,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final DistributionPackadeliServiceImpl distributionPackadeliService;
private final DistributionLoadscanordMapper distributionLoadscanordMapper;
private final DistributionLoadscanresMapper distributionLoadscanresMapper;
private final DistributionDeliverySelfMapper distributionDeliverySelfMapper;
private final BladeRedis bladeRedis;
@Override
@ -238,32 +240,55 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//获取当前用户司机
DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectById(distrilbutionloadingscanDTO.getLoadingId());
if (distrilbutionloadingscanDTO.getType() == 1) {
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getPacketBarCode, distrilbutionloadingscanDTO.getBarcode())
);
if (distrilbutionloadingscanDTO.getStockType() ==1) {
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
// List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
// .eq(DistributionLoadscanEntity::getPacketBarCode, distrilbutionloadingscanDTO.getBarcode())
// );
// List<DistributionDeliveryListEntity> distributionDeliveryListEntities = distributionDeliveryListMapper.selectList(new QueryWrapper<DistributionDeliveryListEntity>()
// .lambda().eq(DistributionDeliveryListEntity::getState, 1).like(DistributionDeliveryListEntity::getDriverId, user.getUserId())
// );
if (distributionLoadscanEntities.size() <= 0) {
return R.fail(3001, "窜货");
}
//获取当前用户司机
if (distributionLoadscanEntities.size() <= 0) {
return R.fail(3001, "窜货");
}
// BladeUser user = AuthUtil.getUser();
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
if (distributionLoadscanEntity.getScanStatus() != 1) {return R.fail(3002, "重复扫码");}
//依次更新该装车记录,设置车辆
distributionLoadscanMapper.updateSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
.eq(DistributionLoadscanEntity::getPacketBarCode, distributionLoadscanEntity.getPacketBarCode())
);
if (distributionLoadscanEntitiesflag.size() > 0) {
return R.fail(3002, "重复扫码");
}
//依次插入该装车记录,设置车辆
distributionLoadscanEntity.setDriverId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
distributionLoadscanEntity.setScanStatus(2);
distributionLoadscanEntity.setType(2);
distributionLoadscanEntity.setScanTime(new Date());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
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.getReservationId());
//判断是商配还是市配
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub());
//判断是商配还是市配
// DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
// if (distributionDeliveryListEntity.getType().equals("1")) {
// //判断签收表有无客户信息,没有就加入信息
@ -287,10 +312,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// distributionSignforEntity.setDriverSigning("1");
// distributionSignforMapper.insert(distributionSignforEntity);
// }
// }
}
// }
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
// //找出该包条码
// List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListMapper.selectList(new QueryWrapper<DistributionParcelListEntity>().lambda()
// .eq(DistributionParcelListEntity::getPacketBarCode, distrilbutionloadingscanDTO.getBarcode()));
@ -316,37 +340,120 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// distributionLoadscanMapper.updateByPackageId(e.getId());
// }
// }
}else if (distrilbutionloadingscanDTO.getStockType() ==2){
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() <= 0) {
return R.fail(3001, "窜货");
}
// BladeUser user = AuthUtil.getUser();
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
.eq(DistributionLoadscanEntity::getPacketBarCode, distributionLoadscanEntity.getPacketBarCode())
);
if (distributionLoadscanEntitiesflag.size() > 0) {
return R.fail(3002, "重复扫码");
}
//依次插入该装车记录,设置车辆
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(2);
distributionLoadscanEntity.setType(2);
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
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(),distributionLoadscanEntity.getPackageNub());
//判断是商配还是市配
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
}
} else if (distrilbutionloadingscanDTO.getType() == 2) {
//TODO 托盘扫描
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getTrayId, distrilbutionloadingscanDTO.getBarcode())
);
if (distributionLoadscanEntities.size() < 0) {
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverypallet(distrilbutionloadingscanDTO.getBarcode(),distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() <= 0) {
return R.fail(3001, "窜货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
if (distributionLoadscanEntity.getScanState() != 1) {
return R.fail(3003, "有扫描过的货物");
//查询是否重复扫码
List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
.eq(DistributionLoadscanEntity::getPacketBarCode, distributionLoadscanEntity.getPacketBarCode())
);
if (distributionLoadscanEntitiesflag.size() > 0) {
return R.fail(3002, "有扫描过的货物");
}
if (distributionLoadscanEntity.getDeliveryId() != distrilbutionloadingscanDTO.getDeliveryId()) {
return R.fail(3004, "有其他车次货物");
}
//依次更新该装车记录,设置车辆
distributionLoadscanMapper.updateSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
// distributionLoadscanordMapper.updateSumById(distributionLoadscanEntity.getOrderId(),distrilbutionloadingscanDTO);
// distributionLoadscanresMapper.updateSumById(distributionLoadscanEntity.getReservationId(),distrilbutionloadingscanDTO);
//依次插入该装车记录,设置车辆
distributionLoadscanEntity.setDriverId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(2);
distributionLoadscanEntity.setType(2);
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setTrayNo(distributionLoadscanEntity.getPacketBarCode());
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId());
// Integer c = distributionSignforMapper.selectCount(new QueryWrapper<DistributionSignforEntity>().lambda().eq(DistributionSignforEntity::get));
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub());
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
} else if (distrilbutionloadingscanDTO.getType() == 3) {
//订单扫描
//查询订单是否属于该配送任务
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.getReservationId())
.eq(DistributionLoadscanEntity::getPacketBarCode, distributionLoadscanEntity.getPacketBarCode())
);
if (distributionLoadscanEntitiesflag.size() > 0) {
return R.fail(3002, "重复扫描");
}
//依次插入该装车记录,设置车辆
distributionLoadscanEntity.setDriverId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(2);
distributionLoadscanEntity.setType(2);
distributionLoadscanEntity.setScanTime(new Date());
distributionLoadscanEntity.setScanState(1);
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub());
}
distributionLoadscanService.saveBatch(distributionLoadscanEntities);
}
return R.success("成功");
@ -362,6 +469,33 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//TODO 用个配送司机车辆中间表字段存储状态
//查询是否属于该配送任务
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
/*
1. 通过查询这个所有的预约单
2.通过预约单ID 得到所有的订单
2.1 得到预约单下面包件
3.通过预约单Id 得到搜友的库存品及其预约数量
4. 插入
// todo 展示不插入
5. 更新
5.1 更新预约单的状态
5.2 更新预约单关联的订单状态
5.3 更新预约单关联订单下面的包间状态
5.4 更新配送表状态
#5.3 更新预约单关联库存品的数量
*/
//将该客户所有的物品上该车辆
return null;
}
@ -374,19 +508,20 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Override
public R loadingscanoff(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
if (distrilbutionloadingscanDTO.getType() == 1) {
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.eq(DistributionLoadscanEntity::getPacketBarCode, distrilbutionloadingscanDTO.getBarcode())
);
if (distributionLoadscanEntities.size() < 0) {
return R.fail(3001, "窜货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//更新该装车记录
distributionLoadscanMapper.updatecutSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
if (distrilbutionloadingscanDTO.getStockType()==1) {
//查询该包条是否属于该配送任务
List<DistributionLoadscanEntity> distributionLoadscanEntities = baseMapper.selectdeliverywork(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
if (distributionLoadscanEntities.size() >0) {
return R.fail(3001, "窜货");
}
for (DistributionLoadscanEntity distributionLoadscanEntity : distributionLoadscanEntities) {
//取消装车,更新该装车记录
distributionLoadscanMapper.updatecutSumById(distributionLoadscanEntity.getId(), distrilbutionloadingscanDTO);
// distributionLoadscanordMapper.updatecutSumById(distributionLoadscanEntity.getOrderId(),distrilbutionloadingscanDTO);
// distributionLoadscanresMapper.updatecutSumById(distributionLoadscanEntity.getReservationId(),distrilbutionloadingscanDTO);
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadreduceByReservationId(distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getPackageNub());
}
}
} else if (distrilbutionloadingscanDTO.getType() == 2) {
//TODO 托盘扫描
@ -407,6 +542,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
}
}else if (distrilbutionloadingscanDTO.getType() == 3){
}
return R.success("成功");
}

Loading…
Cancel
Save