Browse Source

装车代码

dist.1.3.0
汤建军 5 months ago
parent
commit
b4566579e8
  1. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/DistrilbutionloadingscanDTO.java
  3. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.java
  4. 16
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  5. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  6. 105
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java

@ -196,7 +196,25 @@ public class DistributionDeliveryAppController {
msg = R.fail(e.getMessage());
log.error(e.getMessage());
}
return msg;
}
/**
* 配送管理 装车扫描
*/
@PostMapping("/newLoadingscan")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public R newLoadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = null;
try{
msg = distributionDeliveryListService.newLoadingscan(distrilbutionloadingscanDTO);
}catch (Exception e){
msg = R.fail(e.getMessage());
log.error(e.getMessage());
}
return msg;
}

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

@ -90,7 +90,7 @@ public class DistrilbutionloadingscanDTO {
/**
* 扫描物品
*/
@ApiModelProperty(value = "扫描物品(1-包条,2-托盘,3-订单)")
@ApiModelProperty(value = "扫描物品(1-包条,2-零担,3-库存品,4-托盘)")
// @NotEmpty(message = "扫描物品不能为空")
private Integer type;

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

@ -545,4 +545,11 @@ public interface DistributionDeliveryListMapper extends BaseMapper<DistributionD
* @return
*/
List<DistributionParcelNumberVO> selectDeliveryZeroOrderInfoDetail(Long id, Long id1);
/**
* 查询计划中的包件信息
* @param orderPackageCode
* @param deliveryId
*/
Long selectPackageByorderPackageCodeAndDeliveryId(@Param("orderPackageCode")String orderPackageCode,@Param("deliveryId") Long deliveryId,@Param("warehouseId") Long warehouseId);
}

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

@ -2577,5 +2577,21 @@
AND ldrs.stock_article_status in ('1','3')
AND ldrzp.zero_package_status IN ( '1', '3' )
</select>
<select id="selectPackageByorderPackageCodeAndDeliveryId"
resultType="java.lang.Long">
SELECT
ldrp.reservation_id
FROM
logpm_distribution_reservation_package AS ldrp
LEFT JOIN logpm_distribution_signfor AS lds ON ldrp.reservation_id = lds.reservation_id
LEFT JOIN logpm_distribution_delivery_list AS lddl ON lds.delivery_id = lddl.id AND lddl.is_deleted = 0
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id
WHERE
ldrp.packet_bar_code = #{orderPackageCode}
AND lddl.id = #{deliveryId}
AND ldrp.is_deleted = 0
AND ldrp.packet_bar_status != 2
AND ldpl.warehouse_id = #{warehouseId}
</select>
</mapper>

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

@ -501,6 +501,14 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/
R selectDistributionNewAppDeliverywrap(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/**
* 签收扫描
* @param distrilbutionloadingscanDTO
* @return
*/
R newLoadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
* 查询签收预约客户包件信息

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

@ -2130,20 +2130,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//查询当前登录人满足的配送计划
//获取当前登录人
BladeUser user = AuthUtil.getUser();
String roleId = user.getRoleId();
//判断当前登录人是否为司机
boolean delivery = false;
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new");
String[] roleIds = value1.split(",");
String[] roleIdsT = roleId.split(",");
for (String id : roleIds) {
for (String s : roleIdsT) {
if (s.equals(id)) {
delivery = true;
break;
}
}
}
Boolean delivery = judgeIsDriver(user);
if (delivery) {
//查询当前登录人的配送任务
@ -2183,6 +2173,23 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.data(distributionAppDeliveryListVOS);
}
private Boolean judgeIsDriver(BladeUser user) {
boolean delivery = false;
String roleId = user.getRoleId();
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new");
String[] roleIds = value1.split(",");
String[] roleIdsT = roleId.split(",");
for (String id : roleIds) {
for (String s : roleIdsT) {
if (s.equals(id)) {
delivery = true;
break;
}
}
}
return delivery;
}
@Override
public DistributionAppDeliveryListVO getAppDeliverydetailVO(DistributionDeliveryListEntity detail) {
DistributionAppDeliveryListVO distributionAppDeliveryListVO = new DistributionAppDeliveryListVO();
@ -7998,6 +8005,78 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.data(detailVO);
}
@Override
public R newLoadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//参数校验
String method = "########################DistributionAppDeliveryListServiceImpl.newLoadingscan";
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())){
log.error(method+"参数缺失DeliveryId");
return Resp.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())){
log.error(method+"参数缺失Barcode");
return Resp.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getType())){
log.error(method+"参数缺失Type");
return Resp.fail("参数缺失,请联系管理员");
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
log.error(method+"作业未选择仓库");
return R.fail(403,"未授权!!!");
}
Integer type = distrilbutionloadingscanDTO.getType();
String orderPackageCode = distrilbutionloadingscanDTO.getBarcode();
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
Long warehouseId = myCurrentWarehouse.getId();
//查询当前登录人所在计划
BladeUser user = AuthUtil.getUser();
Boolean isDriverFlag = judgeIsDriver(user);
if (!isDriverFlag) {
return R.fail(403,"无权限执行此操作!!!");
}
switch (type){
case 1 :
DistributionParcelListEntity parcelListEntity = distributionParcelListMapper.selectByOrderPackageCode(orderPackageCode, myCurrentWarehouse.getId());
if (Objects.isNull(parcelListEntity)){
//查询是否为库存品
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (list.isEmpty()){
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码");
} else {
return Resp.scanFail("系统无编码", "系统无编码");
}
if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){
return Resp.scanFail("此包件已装车", "此包件已装车");
}
//再次校验是否装车
//查询是否满足计划 以及计划在哪个客户中
Long reservationId = baseMapper.selectPackageByorderPackageCodeAndDeliveryId(orderPackageCode,deliveryId,warehouseId);
if (Objects.isNull(reservationId)){
//判定是否满足异常装车
}
//正常进行装车
}
break;
}
return null;
}
private List<DistributionAppStockListVO> handleAppDeliveryInventory(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO, BasicdataWarehouseEntity myCurrentWarehouse) {
List<DistributionAppStockListVO> distributionAppStockListVOS = new ArrayList<>();
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionAppDeliveryListDTO.getId());

Loading…
Cancel
Save