Browse Source

装车代码提交

dist.1.3.0
汤建军 7 months ago
parent
commit
149e6ecb8d
  1. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java
  2. 48
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseConfigClient.java
  3. 11
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java
  4. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java
  5. 20
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java
  6. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionDeliveryAppController.java
  7. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  8. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  9. 62
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  10. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java
  11. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java
  12. 185
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  13. 110
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  14. 38
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseConfigController.java
  15. 49
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseConfigClient.java

5
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataWarehouseVO.java

@ -39,6 +39,11 @@ public class BasicdataWarehouseVO extends BasicdataWarehouseEntity {
@ApiModelProperty(value = "仓库货区") @ApiModelProperty(value = "仓库货区")
private List<BasicdataGoodsAreaEntity> children; private List<BasicdataGoodsAreaEntity> children;
/**
* 是否严格装车
*/
private boolean strictLoading = false;

48
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseConfigClient.java

@ -0,0 +1,48 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* ReWarehouse and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* ReWarehouses of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* ReWarehouses in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the Warehouse.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.feign;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseStockEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 备货扫描记录 Feign接口类
*
* @author lmy
* @since 2023-08-24
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_WAREHOUSE_NAME
)
public interface IWarehouseConfigClient {
String API_PREFIX = "WarehouseConfig/client";
String TOP = API_PREFIX + "/top";
/**
* 查询当前仓库扩展配置
* @return BladePage
*/
@GetMapping(TOP)
WarehouseConfigEntity getWarehouseConfig(@RequestParam("warehouseId") Long warehouseId);
}

11
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataWarehouseController.java

@ -89,17 +89,6 @@ public class BasicdataWarehouseController extends BladeController {
return R.data(detail); return R.data(detail);
} }
/**
* 仓库 详情
*/
@GetMapping("/newDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入warehouseWarehouse")
public R<BasicdataWarehouseVO> newDetail(@RequestParam Long id) {
BasicdataWarehouseVO detail = warehouseService.newDetail(id);
return R.data(detail);
}
/** /**
* 查询部门下的仓库 * 查询部门下的仓库
*/ */

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataWarehouseService.java

@ -132,10 +132,4 @@ public interface IBasicdataWarehouseService extends BaseService<BasicdataWarehou
BasicdataWarehouseVO getMyCurrentWarehouseAndConfig(); BasicdataWarehouseVO getMyCurrentWarehouseAndConfig();
/**
* 查询仓库详情连同扩展配置
* @param id
* @return
*/
BasicdataWarehouseVO newDetail(Long id);
} }

20
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataWarehouseServiceImpl.java

@ -35,6 +35,8 @@ import com.logpm.basicdata.mapper.BasicdataStorageServicesMapper;
import com.logpm.basicdata.mapper.BasicdataWarehouseMapper; import com.logpm.basicdata.mapper.BasicdataWarehouseMapper;
import com.logpm.basicdata.service.IBasicdataWarehouseService; import com.logpm.basicdata.service.IBasicdataWarehouseService;
import com.logpm.basicdata.vo.BasicdataWarehouseVO; import com.logpm.basicdata.vo.BasicdataWarehouseVO;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.feign.IWarehouseConfigClient;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springblade.common.cache.CacheNames; import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.DictBizConstant;
@ -71,6 +73,9 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Autowired @Autowired
private BasicdataGoodsAreaMapper goodsAreaMapper; private BasicdataGoodsAreaMapper goodsAreaMapper;
@Autowired
private IWarehouseConfigClient warehouseConfigClient;
@Autowired @Autowired
private IDeptClient deptClient; private IDeptClient deptClient;
@Autowired @Autowired
@ -358,13 +363,16 @@ public class BasicdataWarehouseServiceImpl extends BaseServiceImpl<BasicdataWare
@Override @Override
public BasicdataWarehouseVO getMyCurrentWarehouseAndConfig() { public BasicdataWarehouseVO getMyCurrentWarehouseAndConfig() {
BasicdataWarehouseEntity myCurrentWarehouse = getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = getMyCurrentWarehouse();
BasicdataWarehouseVO warehouseVO = Func.copy(myCurrentWarehouse, BasicdataWarehouseVO.class);
//查询仓库的扩展配置
if (!Func.isEmpty(myCurrentWarehouse)){
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
if (!Func.isEmpty(warehouseConfig)){
warehouseVO.setStrictLoading(true);
}
}
return null; return warehouseVO;
} }
@Override
public BasicdataWarehouseVO newDetail(Long id) {
// baseMapper.
return null;
}
} }

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

@ -217,22 +217,6 @@ public class DistributionDeliveryAppController {
return msg; return msg;
} }
/**
* 配送管理 装车扫描
*/
@PostMapping("/newCancelLoadingscan")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "装车扫描", notes = "传入DistrilbutionloadingscanDTO")
public R newCancelLoadingscan(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
R msg = null;
try{
msg = distributionDeliveryListService.newCancelLoadingscan(distrilbutionloadingscanDTO);
}catch (Exception e){
msg = R.fail(e.getMessage());
log.error(e.getMessage());
}
return msg;
}
/** /**
* 零担装车 * 零担装车
@ -317,7 +301,7 @@ public class DistributionDeliveryAppController {
@PostMapping("/start") @PostMapping("/start")
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@ApiOperation(value = "发车", notes = "传入DistrilbutionloadingscanDTO") @ApiOperation(value = "发车", notes = "传入DistrilbutionloadingscanDTO")
public R loadinginventoryDe(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) { public R loadingStart(@Valid @RequestBody DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
return distributionDeliveryListService.loadingStart(distrilbutionloadingscanDTO); return distributionDeliveryListService.loadingStart(distrilbutionloadingscanDTO);
} }

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

@ -119,6 +119,17 @@ public class DistributionSignforController extends BladeController {
return r; return r;
} }
/**
* 异常装车包件列表
*/
@GetMapping("/newLoadingAbnormalPackageListDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入distributionSignfor")
public R newLoadingAbnormalPackageListDetail(@RequestParam Long signId) {
R r = distributionSignforService.newLoadingAbnormalPackageListDetail(signId);
return r;
}
/** /**
* 异常装车包件列表 * 异常装车包件列表
*/ */

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

@ -459,4 +459,12 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
* @return * @return
*/ */
List<DisStockListDetailVO> selectAppDeliveryInventoryPackage(@Param("reservationId")Long reservationId); List<DisStockListDetailVO> selectAppDeliveryInventoryPackage(@Param("reservationId")Long reservationId);
/**
*
* @param reservationId
* @param deliveryId
* @return
*/
List<DistributionLoadscanAbnormalVO> selectNewAbnormalPackageList(@Param("reservationId")Long reservationId,@Param("deliveryId") Long deliveryId);
} }

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

@ -1126,11 +1126,11 @@
ldpl.id AS packageId ldpl.id AS packageId
FROM FROM
logpm_distribution_loadscan_abnormal AS ldla logpm_distribution_loadscan_abnormal AS ldla
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldla.package_id = ldl.package_id LEFT JOIN logpm_distribution_loadscan AS ldl ON ldla.loading_id = ldl.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id
WHERE WHERE
ldla.reservation_id = #{reservationId} and ldl.reservation_id = #{reservationId} and ldla.delivery_list_id = ldla.reservation_id = #{reservationId} and ldla.delivery_list_id =
#{deliveryListId} AND ldl.scan_status != 1 AND ldl.is_deleted = 0 AND ldla.is_deleted = 0 #{deliveryListId} AND ldla.is_deleted = 0
</select> </select>
<select id="selectSignImgsUrl" resultType="com.logpm.distribution.vo.DistributionSignPrintVO"> <select id="selectSignImgsUrl" resultType="com.logpm.distribution.vo.DistributionSignPrintVO">
SELECT * FROM logpm_distribution_sign_print WHERE reservation_id = #{reservationId} and is_deleted = 0 SELECT * FROM logpm_distribution_sign_print WHERE reservation_id = #{reservationId} and is_deleted = 0
@ -2198,5 +2198,61 @@
AND ldsld.reservation_id = #{reservationId} AND ldsld.reservation_id = #{reservationId}
AND ldsld.stock_package_status != 2 AND ldsld.stock_package_status != 2
</select> </select>
<select id="selectNewAbnormalPackageList"
resultType="com.logpm.distribution.vo.DistributionLoadscanAbnormalVO">
SELECT
ldla.id AS id,
ldla.auditing_status AS auditingStatus,
CASE
WHEN ldla.auditing_status = 1 THEN
'待审核'
WHEN ldla.auditing_status = 2 THEN
'已审核' ELSE '已驳回'
END AS auditingStatusName,
ldla.auditing_time AS auditingTime,
ldla.auditing_user AS auditingUser,
ldla.delivery_type AS deliveryType,
ldla.reservation_id AS reservationId,
ldla.delivery_list_id AS deliveryListId,
ldla.scan_time AS scanTime,
ldla.scan_user AS scanUser,
ldla.package_code AS packageCode,
ldla.train_number AS trainNumber,
ldla.loading_quantity AS loadingQuantity,
ldl.signing_time AS signingTime,
ldl.signing_user AS signingUser,
ldpl.firsts AS firsts,
ldpl.SECOND AS `second`,
ldpl.third_product AS thirdProduct,
ldpl.order_code AS orderCode,
ldpl.service_number AS serviceNumber,
ldpl.waybill_number AS waybillNumber,
ldpl.order_package_status AS orderPackageStatus,
ldpl.order_package_freeze_status AS orderPackageFreezeStatus,
ldpl.order_package_grounding_status AS orderPackageGroundingStatus,
ldpl.order_package_stockup_status AS orderPackageStockupStatus,
ldpl.order_package_reservation_status AS orderPackageReservationStatus,
ldpl.order_package_loading_status AS orderPackageLoadingStatus,
ldpl.material_name AS materialName,
ldpl.id AS packageId,
CASE
ldla.abnormal_type
WHEN 1 THEN
'装车异常'
WHEN 2 THEN
'计划异常'
WHEN 3 THEN
'签收异常' ELSE '未知'
END abnormalTypeName
FROM
logpm_distribution_loadscan_abnormal AS ldla
LEFT JOIN logpm_distribution_loadscan AS ldl ON ldla.loading_id = ldl.id
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldla.package_id = ldpl.id
WHERE
ldla.reservation_id = 1834121310973964290
AND ldla.delivery_list_id = 1834121296369397761
AND ldla.is_deleted = 0
</select>
</mapper> </mapper>

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

@ -527,21 +527,7 @@ public interface IDistributionDeliveryListService extends BaseService<Distributi
*/ */
R newAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO); R newAbnormalLoading(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
* 取消装车
* @param distrilbutionloadingscanDTO
* @return
*/
R newCancelLoadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO);
/**
* 查询签收预约客户包件信息
* @param reservationId
* @param scanBarCode
* @return
*/
// /** // /**
// * 滞留取消配送 // * 滞留取消配送

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

@ -400,4 +400,11 @@ public interface IDistributionSignforService extends BaseService<DistributionSig
R selectNewAppDeliveryCustomDetail(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); R selectNewAppDeliveryCustomDetail(DistributionAppDeliveryListDTO distributionAppDeliveryListDTO);
/**
* 查询配送异常列表
* @param signId
* @return
*/
R newLoadingAbnormalPackageListDetail(Long signId);
} }

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

@ -2591,7 +2591,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
checkArgs(deliveryListDTO, myCurrentWarehouse); checkArgs(deliveryListDTO, myCurrentWarehouse);
//是否发车限制
if (DeliveryStartStatusConstant.yifache.getValue().equals(deliveryListEntity.getIsStart())){
return R.fail("当前车次已发车");
}
List<JSONObject> logs = new ArrayList<>(); List<JSONObject> logs = new ArrayList<>();
List<JSONObject> pushDatas = new ArrayList<>(); List<JSONObject> pushDatas = new ArrayList<>();
//查询出原来配送信息的备货任务 //查询出原来配送信息的备货任务
@ -4635,16 +4638,20 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (!isDriverFlag) { if (!isDriverFlag) {
return Resp.scanFail("当前操作人必须是司机!", "当前操作人必须是司机!"); return Resp.scanFail("当前操作人必须是司机!", "当前操作人必须是司机!");
} }
//统计该配送任务的库存品装车数
Integer abnormalPackageLoadingNum = distributionLoadscanMapper.statisticsAbnormalLoadingNum(distrilbutionloadingscanDTO.getDeliveryId());
if (abnormalPackageLoadingNum != 0) {
return Resp.scanFail("存在异常请处理", "存在异常请处理");
}
String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()); String format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date());
String loadingId = distrilbutionloadingscanDTO.getLoadingId(); String loadingId = distrilbutionloadingscanDTO.getLoadingId();
Boolean b = false; Boolean b = false;
Boolean isEnd = false; Boolean isEnd = false;
//防止司机进行重复发车点击 //防止司机进行重复发车点击
Long isRepeat = bladeRedis.get(AuthUtil.getTenantId() + "warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:"); Long isRepeat = bladeRedis.get(AuthUtil.getTenantId() + ":warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:");
if (Func.isNotEmpty(isRepeat)) { if (Func.isNotEmpty(isRepeat)) {
return Resp.scanFail("请勿重复发车", "请勿重复发车"); return Resp.scanFail("请勿重复发车", "请勿重复发车");
} }
if ("1".equals(distributionDeliveryListEntity.getKind())) { if ("1".equals(distributionDeliveryListEntity.getKind())) {
DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO, isDriverFlag); DistributionDeliverySelfEntity distributionDeliverySelfEntity = getDriver(distributionDeliveryListEntity, user, distrilbutionloadingscanDTO, isDriverFlag);
distributionDeliverySelfEntity.setDepartureTime(format); distributionDeliverySelfEntity.setDepartureTime(format);
@ -4654,7 +4661,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
b = distributionDeliveryTripartiteService.update(new UpdateWrapper<DistributionDeliveryTripartiteEntity>().lambda() b = distributionDeliveryTripartiteService.update(new UpdateWrapper<DistributionDeliveryTripartiteEntity>().lambda()
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) .eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())
.set(DistributionDeliveryTripartiteEntity::getDepartureTime, format)); .set(DistributionDeliveryTripartiteEntity::getDepartureTime, format));
isEnd = true;// isEnd = true;
} }
//处理最后一个司机进行发车 //处理最后一个司机进行发车
//判断是否是最后一个司机点发车 //判断是否是最后一个司机点发车
@ -4665,7 +4672,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
contrastPlanAndLoading(distributionDeliveryListEntity, myCurrentWarehouse); contrastPlanAndLoading(distributionDeliveryListEntity, myCurrentWarehouse);
//进行发车日志记录 //进行发车日志记录
} }
bladeRedis.setEx(AuthUtil.getTenantId() + "warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:", user.getUserId(), 60L * 30L); bladeRedis.setEx(AuthUtil.getTenantId() + ":warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "driverId:", user.getUserId(), 60L * 30L);
//修改主表状态 //修改主表状态
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue());
baseMapper.updateById(distributionDeliveryListEntity); baseMapper.updateById(distributionDeliveryListEntity);
@ -4699,11 +4706,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
if (loadingCount != 0) { if (loadingCount != 0) {
builder.append("装车" + loadingCount + "件"); builder.append("装车" + loadingCount + "件");
} }
//统计该配送任务的库存品装车数
Integer abnormalPackageLoadingNum = distributionLoadscanMapper.statisticsAbnormalLoadingNum(distrilbutionloadingscanDTO.getDeliveryId());
if (abnormalPackageLoadingNum != 0) {
return Resp.scanFail("存在异常请处理", "存在异常请处理");
}
distributionAsyncService.sendTrunkineLog(distributionDeliveryListEntity.getId(), null, AuthUtil.getUser(), warehouseClient.getMyCurrentWarehouse(), 1); distributionAsyncService.sendTrunkineLog(distributionDeliveryListEntity.getId(), null, AuthUtil.getUser(), warehouseClient.getMyCurrentWarehouse(), 1);
Map mapState = new HashMap(); Map mapState = new HashMap();
mapState.put("messageId", CommonUtil.getUUID()); mapState.put("messageId", CommonUtil.getUUID());
@ -4755,15 +4758,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<DistributionLoadscanAbnormalEntity> abnormalEntityList = new ArrayList<>(); List<DistributionLoadscanAbnormalEntity> abnormalEntityList = new ArrayList<>();
if (!distributionParcelListEntities.isEmpty()) { if (!distributionParcelListEntities.isEmpty()) {
for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) { for (DistributionParcelListEntity distributionParcelListEntity : distributionParcelListEntities) {
DistributionLoadscanAbnormalEntity packageLoadscanAbnormalEntity = createdPakcageAbnormal(distributionDeliveryList, distributionParcelListEntity, warehouseEntity); if (OrderPackageLoadingStatusConstant.weizhuancghe.getValue().equals(distributionParcelListEntity.getOrderPackageLoadingStatus())){
abnormalEntityList.add(packageLoadscanAbnormalEntity); DistributionLoadscanAbnormalEntity packageLoadscanAbnormalEntity = createdPakcageAbnormal(distributionDeliveryList, distributionParcelListEntity, warehouseEntity);
abnormalEntityList.add(packageLoadscanAbnormalEntity);
}
} }
} }
List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionDeliveryList.getId()); List<DisStockListDetailEntity> disStockListDetailEntities = baseMapper.selectInventoryListByDeliveryListId(distributionDeliveryList.getId());
if (!disStockListDetailEntities.isEmpty()) { if (!disStockListDetailEntities.isEmpty()) {
for (DisStockListDetailEntity disStockListDetailEntity : disStockListDetailEntities) { for (DisStockListDetailEntity disStockListDetailEntity : disStockListDetailEntities) {
DistributionLoadscanAbnormalEntity inventoryLoadscanAbnormalEntity = createdInventoryPakcageAbnormal(distributionDeliveryList, disStockListDetailEntity, warehouseEntity); if (InventoryLoadingStatusConstant.weizhuangche.getValue().equals(disStockListDetailEntity.getStockLockingStatus())){
abnormalEntityList.add(inventoryLoadscanAbnormalEntity); DistributionLoadscanAbnormalEntity inventoryLoadscanAbnormalEntity = createdInventoryPakcageAbnormal(distributionDeliveryList, disStockListDetailEntity, warehouseEntity);
abnormalEntityList.add(inventoryLoadscanAbnormalEntity);
}
} }
} }
//零担 //零担
@ -4772,11 +4779,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
abnormalEntityList.addAll(zeroLoadscanAbnormalList); abnormalEntityList.addAll(zeroLoadscanAbnormalList);
} }
if (!abnormalEntityList.isEmpty()) { if (!abnormalEntityList.isEmpty()) {
//进行装车异常生成
distributionLoadscanAbnormalService.saveBatch(abnormalEntityList); distributionLoadscanAbnormalService.saveBatch(abnormalEntityList);
} }
} }
private DistributionLoadscanAbnormalEntity createdPakcageAbnormal(DistributionDeliveryListEntity distributionDeliveryList, DistributionParcelListEntity distributionParcelListEntity, BasicdataWarehouseEntity warehouseEntity) { private DistributionLoadscanAbnormalEntity createdPakcageAbnormal(DistributionDeliveryListEntity distributionDeliveryList, DistributionParcelListEntity distributionParcelListEntity, BasicdataWarehouseEntity warehouseEntity) {
@ -9264,153 +9268,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return Resp.scanSuccess("操作成功", "异常" + abnormalTotal + "件"); return Resp.scanSuccess("操作成功", "异常" + abnormalTotal + "件");
} }
@Override
public R newCancelLoadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
String method = "######################DistributionDeliveryServiceImpl.newCancelLoadingscan";
if (Objects.isNull(distrilbutionloadingscanDTO.getBarcode())) {
log.error(method + "参数缺失Barcode");
return Resp.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getDeliveryId())) {
log.error(method + "参数缺失DeliveryId");
return Resp.fail("参数缺失,请联系管理员");
}
if (Objects.isNull(distrilbutionloadingscanDTO.getReservationId())) {
log.error(method + "参数缺失ReservationId");
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 + "参数缺失Type()");
return R.fail(403, "未授权!!!");
}
Long deliveryId = distrilbutionloadingscanDTO.getDeliveryId();
Long reservationId = distrilbutionloadingscanDTO.getReservationId();
DistributionDeliveryListEntity deliveryListEntity = this.getById(distrilbutionloadingscanDTO.getDeliveryId());
if (Objects.isNull(deliveryListEntity)) {
log.error(method + "查询配送失败,deliveryId:{}", deliveryId);
return Resp.fail("配送信息错误,请联系管理员");
}
if (!DeliveryStartStatusConstant.daifache.getValue().equals(deliveryListEntity.getIsStart())) {
return Resp.scanFail("当前车次已发车", "当前车次已发车");
}
DistributionReservationEntity reservationEntity = distributionReservationService.getById(reservationId);
if (Objects.isNull(deliveryListEntity)) {
log.error(method + "查询预约失败,reservationId:{}", reservationId);
return Resp.fail("预约计划错误,请联系管理员");
}
switch (distrilbutionloadingscanDTO.getType()) {
case 1:
//订制品
if (Objects.isNull(distrilbutionloadingscanDTO.getPackageIds())) {
log.error(method + "参数缺失PackageIds()");
return Resp.fail("参数缺失,请联系管理员");
}
List<Long> ids = Func.toLongList(distrilbutionloadingscanDTO.getPackageIds());
//校验包件是否存在签收包件
List<DistributionParcelListEntity> parcelListEntities = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.in(DistributionParcelListEntity::getId, ids)
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (parcelListEntities.isEmpty()) {
log.error(method + "查询包件失败:packageIds:{}", ids);
return Resp.scanFail("包件数据错误,请联系管理员", "包件数据错误,请联系管理员");
}
boolean isSignfor = parcelListEntities.stream().anyMatch(f -> OrderPackageStatusConstant.yiqianshou.getValue().equals(f.getOrderPackageStatus()));
if (isSignfor) {
//存在签收包件 无法继续进行取消操作
String errorOrderPackageCode = parcelListEntities.stream().filter(f -> OrderPackageStatusConstant.yiqianshou.getValue().equals(f.getOrderPackageStatus())).map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
return Resp.fail("操作失败," + errorOrderPackageCode + "已签收");
}
boolean isLoading = parcelListEntities.stream().anyMatch(f -> OrderPackageLoadingStatusConstant.weizhuancghe.getValue().equals(f.getOrderPackageLoadingStatus()));
if (isLoading) {
//存在签收包件 无法继续进行取消操作
String errorOrderPackageCode = parcelListEntities.stream().filter(f -> OrderPackageLoadingStatusConstant.weizhuancghe.getValue().equals(f.getOrderPackageLoadingStatus())).map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(","));
return Resp.fail("操作失败," + errorOrderPackageCode + "未装车");
}
//进行装车取消
distributionLoadscanService.remove(Wrappers.<DistributionLoadscanEntity>update().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, deliveryId)
.eq(DistributionLoadscanEntity::getReservationId, reservationId)
.in(DistributionLoadscanEntity::getPackageId, ids)
);
//包件状态维护
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.in(DistributionParcelListEntity::getId, ids)
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
);
//维护订单
String orderCode = parcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).collect(Collectors.joining(","));
distributionStockArticleService.maintenanceOrderInfo(orderCode, myCurrentWarehouse.getId());
//增加日志
List<JSONObject> cancelPackageLogList = handleCancelPackagelog(parcelListEntities, myCurrentWarehouse, deliveryListEntity.getTrainNumber(), reservationEntity.getReservationCode());
if (!cancelPackageLogList.isEmpty()) {
trunklinePackageTrackLogClient.addPackageTrackLog(cancelPackageLogList);
}
//扣减装车数量
distributionSignforMapper.deductionLoadingPacjageNum(reservationId,deliveryId,parcelListEntities.size());
break;
case 2:
//零担
break;
case 3:
if (Objects.isNull(distrilbutionloadingscanDTO.getPackageIds())) {
log.error(method + "参数缺失PackageIds()");
return Resp.fail("参数缺失,请联系管理员");
}
List<Long> inventoryPackageIds = Func.toLongList(distrilbutionloadingscanDTO.getPackageIds());
//查询库存品包件信息
List<DisStockListDetailEntity> disStockListDetailEntities = disStockListDetailService.listByIds(inventoryPackageIds);
if (!disStockListDetailEntities.isEmpty()) {
log.error(method + "查询库存品包件失败:inventoryPackageIds:{}", inventoryPackageIds);
return Resp.scanFail("库存品包件数据错误,请联系管理员", "库存品包件数据错误,请联系管理员");
}
//查询是否存在签收
boolean inventoryIsSignfor = disStockListDetailEntities.stream().anyMatch(f -> InventorySigningStatusConstant.yiqianshou.getValue().equals(f.getStockSignfoStatus()));
if (inventoryIsSignfor) {
String errorInventoryCode = disStockListDetailEntities.stream()
.filter(f -> InventorySigningStatusConstant.yiqianshou.getValue()
.equals(f.getStockSignfoStatus())).map(DisStockListDetailEntity::getStockPackageCode)
.collect(Collectors.joining(","));
return Resp.fail("操作失败," + errorInventoryCode + "已签收");
}
boolean inventoryIsLoading= disStockListDetailEntities.stream().anyMatch(f -> InventoryLoadingStatusConstant.weizhuangche.getValue().equals(f.getStockLockingStatus()));
if (inventoryIsLoading) {
String errorInventoryCode = disStockListDetailEntities.stream()
.filter(f -> InventoryLoadingStatusConstant.weizhuangche.getValue().equals(f.getStockLockingStatus())).map(DisStockListDetailEntity::getStockPackageCode)
.collect(Collectors.joining(","));
return Resp.fail("操作失败," + errorInventoryCode + "未装车");
}
//进行装车取消
distributionLoadscaninvnService.remove(Wrappers.<DistributionLoadscaninvnEntity>update().lambda()
.eq(DistributionLoadscaninvnEntity::getDeliveryId,deliveryId)
.eq(DistributionLoadscaninvnEntity::getReservationId,reservationId)
.in(DistributionLoadscaninvnEntity::getInventoryPackageId,inventoryPackageIds)
.set(DistributionLoadscaninvnEntity::getScanStatus,LoadingStatusConstant.quxiao.getValue())
);
//维护库存品包件状态
disStockListDetailService.update(Wrappers.<DisStockListDetailEntity>update().lambda()
.in(DisStockListDetailEntity::getId,inventoryPackageIds)
.set(DisStockListDetailEntity::getStockLockingStatus,InventoryLoadingStatusConstant.weizhuangche.getValue())
);
//装车数量扣减
distributionSignforMapper.deductionLoadingPacjageNum(reservationId,deliveryId,inventoryPackageIds.size());
//库存品
break;
default:
log.error(method + "未知Type:{}", distrilbutionloadingscanDTO.getType());
return Resp.scanFail("操作失败", "操作失败");
}
//维护预约计划
distributionReservationService.maintenanceReservationInfo(reservationId);
//维护配送计划
this.maintenanceDeliveryInfo(deliveryId);
return Resp.scanSuccess("操作成功","操作成功");
}
private List<JSONObject> handleCancelPackagelog(List<DistributionParcelListEntity> parcelListEntities, BasicdataWarehouseEntity warehouse, String trainNumber, String reservationCode) { private List<JSONObject> handleCancelPackagelog(List<DistributionParcelListEntity> parcelListEntities, BasicdataWarehouseEntity warehouse, String trainNumber, String reservationCode) {
List<JSONObject> packageLogList = new ArrayList<>(); List<JSONObject> packageLogList = new ArrayList<>();

110
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -7231,7 +7231,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setIsAbnormalLoading(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()); distributionLoadscanEntity.setIsAbnormalLoading(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue());
//对异常装车记录进行异常标识的取消 //对异常装车记录进行异常标识的取消
distributionLoadscanService.updateById(distributionLoadscanEntity); distributionLoadscanService.updateById(distributionLoadscanEntity);
} else { } else {
//异常驳回无装车记录 //异常驳回无装车记录
log.error(method + "异常驳回无装车记录"); log.error(method + "异常驳回无装车记录");
@ -7246,18 +7245,18 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} }
//进行装车记录的统计 //进行装车记录的统计
} }
if (yesOrNo) { // if (yesOrNo) {
//恢复包件数据 // //恢复包件数据
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() // distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda()
.in(DistributionParcelListEntity::getId, packageIdList) // .in(DistributionParcelListEntity::getId, packageIdList)
.set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) // .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue())
.set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) // .set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue())
.set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue()) // .set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiruku.getValue())
.set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.daibeihuo.getValue()) // .set(DistributionParcelListEntity::getOrderPackageStockupStatus, OrderPackageStockupStatusConstant.daibeihuo.getValue())
); // );
} // }
//维护相关的订单信息 // //维护相关的订单信息
distributionStockArticleService.maintenanceOrderInfoByIds(orderIds); // distributionStockArticleService.maintenanceOrderInfoByIds(orderIds);
return R.success("异常驳回成功"); return R.success("异常驳回成功");
} }
@ -8245,6 +8244,91 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.data(reservationAppDetailVO); return R.data(reservationAppDetailVO);
} }
@Override
public R newLoadingAbnormalPackageListDetail(Long signId) {
String method = "#########################DistributionSignforServiceImpl.newLoadingAbnormalPackageListDetail";
if (Objects.isNull(signId)){
log.error(method+"signId参数缺失");
return R.fail("参数错误,请联系管理员");
}
DistributionSignforEntity signforEntity = this.getById(signId);
if (Objects.isNull(signforEntity)){
log.error(method+"查询签收失败signId:{}",signId);
return R.fail("签收数据错误,请联系管理员");
}
//这里就需要进行该客户的异常包件列表进行查询
List<DistributionLoadscanAbnormalVO> loadscanAbnormalVOS = baseMapper.selectNewAbnormalPackageList(signforEntity.getReservationId(), signforEntity.getDeliveryId());
loadscanAbnormalVOS.forEach(p -> {
switch (p.getOrderPackageStatus()) {
case "10":
p.setOrderPackageStatusName(OrderPackageStatusConstant.weiruku.getName());
break;
case "20":
p.setOrderPackageStatusName(OrderPackageStatusConstant.yiruku.getName());
break;
case "30":
p.setOrderPackageStatusName(OrderPackageStatusConstant.zhongzhuanruku.getName());
break;
case "40":
p.setOrderPackageStatusName(OrderPackageStatusConstant.zhiliu.getName());
break;
// case "50":
// p.setOrderPackageStatusName(OrderPackageStatusConstant.yichuku.getName());
// break;
case "60":
p.setOrderPackageStatusName(OrderPackageStatusConstant.yichuku.getName());
break;
case "70":
p.setOrderPackageStatusName(OrderPackageStatusConstant.yiqianshou.getName());
break;
default:
log.info("未知的包件状态 {}", p.getOrderPackageStatus());
}
switch (p.getOrderPackageFreezeStatus()) {
case "10":
p.setOrderPackageFreezeStatusName(OrderPackageFreezeStatusConstant.weidongjie.getName());
break;
case "20":
p.setOrderPackageFreezeStatusName(OrderPackageFreezeStatusConstant.yidongjie.getName());
break;
default:
log.info("未知的包件冻结状态 {}", p.getOrderPackageFreezeStatus());
}
switch (p.getOrderPackageLoadingStatus()) {
case "10":
p.setOrderPackageLoadingStatusName(OrderPackageLoadingStatusConstant.weizhuancghe.getName());
break;
case "20":
p.setOrderPackageLoadingStatusName(OrderPackageLoadingStatusConstant.yizhuangche.getName());
break;
default:
log.info("未知的包件装车状态 {}", p.getOrderPackageLoadingStatus());
}
switch (p.getOrderPackageStockupStatus()) {
case "10":
p.setOrderPackageStockupStatusName(OrderPackageStockupStatusConstant.daibeihuo.getName());
break;
case "20":
p.setOrderPackageStockupStatusName(OrderPackageStockupStatusConstant.yibeihu.getName());
break;
default:
log.info("未知的包件备货状态 {}", p.getOrderPackageStockupStatus());
}
switch (p.getOrderPackageReservationStatus()) {
case "10":
p.setOrderPackageReservationStatusName(OrderPackageReservationStatusConstant.daiyuyue.getName());
break;
case "20":
p.setOrderPackageReservationStatusName(OrderPackageReservationStatusConstant.yiyueyue.getName());
break;
default:
log.info("未知的包件预约状态 {}", p.getOrderPackageReservationStatus());
}
});
return R.data(loadscanAbnormalVOS);
}
/** /**
* 修改装车为签收数据 * 修改装车为签收数据
* @param loadscanEntity * @param loadscanEntity

38
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseConfigController.java

@ -17,8 +17,12 @@
package com.logpm.warehouse.controller; package com.logpm.warehouse.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseStockEntity; import com.logpm.warehouse.entity.WarehouseStockEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.excel.WarehouseStockExcel; import com.logpm.warehouse.excel.WarehouseStockExcel;
import com.logpm.warehouse.service.IWarehouseConfigService; import com.logpm.warehouse.service.IWarehouseConfigService;
import com.logpm.warehouse.service.IWarehouseStockService; import com.logpm.warehouse.service.IWarehouseStockService;
@ -61,5 +65,39 @@ public class WarehouseConfigController extends BladeController {
private final IWarehouseConfigService warehouseConfigService; private final IWarehouseConfigService warehouseConfigService;
/**
* 运单表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入warehouseWaybill")
public R save(@Valid @RequestBody WarehouseConfigEntity warehouseConfigEntity) {
return R.status(warehouseConfigService.save(warehouseConfigEntity));
}
/**
* 仓库 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入warehouseWarehouse")
public R<WarehouseConfigEntity> detail(@RequestParam Long warehouseId) {
WarehouseConfigEntity detail = warehouseConfigService.getOne(Wrappers.<WarehouseConfigEntity>query().lambda()
.eq(WarehouseConfigEntity::getWarehouseId,warehouseId)
);
return R.data(detail);
}
/**
* 运单表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入warehouseWaybill")
public R update(@Valid @RequestBody WarehouseConfigEntity warehouseConfigEntity) {
return R.status(warehouseConfigService.updateById(warehouseConfigEntity));
}
} }

49
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseConfigClient.java

@ -0,0 +1,49 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* ReWarehouse and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* ReWarehouses of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* ReWarehouses in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the Warehouse.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseStockEntity;
import com.logpm.warehouse.service.IWarehouseConfigService;
import com.logpm.warehouse.service.IWarehouseStockService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 备货扫描记录 Feign实现类
*
* @author lmy
* @since 2023-08-24
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class WarehouseConfigClient implements IWarehouseConfigClient {
private IWarehouseConfigService warehouseConfigService;
@Override
public WarehouseConfigEntity getWarehouseConfig(Long warehouseId) {
return warehouseConfigService.getOne(Wrappers.<WarehouseConfigEntity>query().lambda().eq(WarehouseConfigEntity::getWarehouseId,warehouseId));
}
}
Loading…
Cancel
Save