Browse Source

库存品一键装车+一键签收出库调整

training
kilo 1 year ago
parent
commit
4960905cd1
  1. 6
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java
  2. 11
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java
  3. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  4. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  5. 385
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

6
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionLoadscaninvnEntity.java

@ -278,6 +278,12 @@ public class DistributionLoadscaninvnEntity extends TenantEntity {
@ApiModelProperty(value = "配送表id") @ApiModelProperty(value = "配送表id")
private Long deliveryId; private Long deliveryId;
/**
* 配送表id
*/
@ApiModelProperty(value = "配送表id")
private Long inventoryPackageId;
/** /**
* 装车数量 * 装车数量
*/ */

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

@ -191,7 +191,7 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
*/ */
Integer updateSignforByReservationId(@Param("deliveryId") Long deliveryId,@Param("reservationId") Long reservationId,@Param("packageNub") Integer packageNub); Integer updateSignforByReservationId(@Param("deliveryId") Long deliveryId,@Param("reservationId") Long reservationId,@Param("packageNub") Integer packageNub);
Integer updatesignforByinvn(@Param("deliveryId") Long deliveryId,@Param("reservationId") Long reservationId,@Param("packageNub") Integer packageNub); Integer updateLoadAndsignforByinvn(@Param("deliveryId") Long deliveryId,@Param("reservationId") Long reservationId,@Param("packageNub") Integer packageNub);
/** /**
* 删除预约配送中间白哦 * 删除预约配送中间白哦
@ -240,4 +240,13 @@ public interface DistributionSignforMapper extends BaseMapper<DistributionSignfo
List<DistributionSignPrintVO> selectSignImgsUrl(@Param("reservationId")Long reservationId); List<DistributionSignPrintVO> selectSignImgsUrl(@Param("reservationId")Long reservationId);
List<DistributionSignforVO> exportDistributionSignforSigningOwn(@Param("param") DistributionSignforVO distributionSignforVO); List<DistributionSignforVO> exportDistributionSignforSigningOwn(@Param("param") DistributionSignforVO distributionSignforVO);
/**
* 修改库存品签收数量
* @param deliveryId
* @param reservationId
* @param packageNub
* @return
*/
Integer updatesignforByinvn(@Param("deliveryId") Long deliveryId,@Param("reservationId") Long reservationId,@Param("packageNub") Integer packageNub);
} }

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

@ -57,9 +57,12 @@
<update id="updateSignforByReservationId"> <update id="updateSignforByReservationId">
UPDATE logpm_distribution_signfor lds set lds.received_quantity = ( lds.received_quantity + #{packageNub} ),lds.loaded_number = ( lds.loaded_number + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId} UPDATE logpm_distribution_signfor lds set lds.received_quantity = ( lds.received_quantity + #{packageNub} ),lds.loaded_number = ( lds.loaded_number + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId}
</update> </update>
<update id="updatesignforByinvn"> <update id="updateLoadAndsignforByinvn">
UPDATE logpm_distribution_signfor lds set lds.loadedin_number = ( lds.loadedin_number + #{packageNub} ),lds.receivedin_quantity = ( lds.receivedin_quantity + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId} UPDATE logpm_distribution_signfor lds set lds.loadedin_number = ( lds.loadedin_number + #{packageNub} ),lds.receivedin_quantity = ( lds.receivedin_quantity + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId}
</update> </update>
<update id="updatesignforByinvn">
UPDATE logpm_distribution_signfor lds set lds.receivedin_quantity = ( lds.receivedin_quantity + #{packageNub} ) WHERE lds.is_deleted =0 and lds.reservation_id = #{reservationId} and lds.delivery_id =#{deliveryId}
</update>
<delete id="deleteByReservationAndDeliveryId"> <delete id="deleteByReservationAndDeliveryId">
DELETE FROM logpm_distribution_signfor DELETE FROM logpm_distribution_signfor
<where> <where>

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

@ -1651,10 +1651,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//存在库存品海为进行装车 //存在库存品海为进行装车
for (DisStockListDetailEntity disStockListDetailEntity : stockListDetailEntityList) { for (DisStockListDetailEntity disStockListDetailEntity : stockListDetailEntityList) {
if (disStockListDetailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())) { if (disStockListDetailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())) {
disStockListDetailEntity.setStockLockingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
disStockListDetailService.updateById(disStockListDetailEntity);
DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity(); DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity();
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
// loadscaninvnEntity.setScanUser(user.getUserName()); // loadscaninvnEntity.setScanUser(user.getUserName());
loadscaninvnEntity.setScanUser(user.getNickName()); loadscaninvnEntity.setScanUser(user.getNickName());
loadscaninvnEntity.setInventoryPackageId(disStockListDetailEntity.getId());
loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
@ -2117,6 +2120,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
} else { } else {
List<DisStockListDetailEntity> disStockListDetailEntities = detailEntities.stream().filter(d -> d.getStockPackageCode().equals(barcode)).collect(Collectors.toList()); List<DisStockListDetailEntity> disStockListDetailEntities = detailEntities.stream().filter(d -> d.getStockPackageCode().equals(barcode)).collect(Collectors.toList());
if (disStockListDetailEntities.size() == 1) { if (disStockListDetailEntities.size() == 1) {
DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(0);
disStockListDetailEntity.setStockLockingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue());
disStockListDetailService.updateById(disStockListDetailEntity);
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = getDistributionLoadscaninvnEntity(distrilbutionloadingscanDTO, distributionDeliverySelfEntity, disStockListDetailEntities); DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = getDistributionLoadscaninvnEntity(distrilbutionloadingscanDTO, distributionDeliverySelfEntity, disStockListDetailEntities);
distributionLoadscaninvnService.save(distributionLoadscaninvnEntity); distributionLoadscaninvnService.save(distributionLoadscaninvnEntity);
//查询本车次是否第一次扫码,没有则更新上车时间 //查询本车次是否第一次扫码,没有则更新上车时间
@ -2143,7 +2149,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
String msg = getLoadingMsg(distrilbutionloadingscanDTO); String msg = getLoadingMsg(distrilbutionloadingscanDTO);
return Resp.scanSuccess("扫描成功", msg); return Resp.scanSuccess("扫描成功", msg);
} }
/** /**
* 构建对象 * 构建对象
* *
@ -2179,6 +2184,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
distributionLoadscaninvnEntity.setInventoryId(disStockListDetailEntities.get(0).getStockListId()); distributionLoadscaninvnEntity.setInventoryId(disStockListDetailEntities.get(0).getStockListId());
distributionLoadscaninvnEntity.setReservationId(disStockListDetailEntities.get(0).getReservationId()); distributionLoadscaninvnEntity.setReservationId(disStockListDetailEntities.get(0).getReservationId());
distributionLoadscaninvnEntity.setOneClick(1); distributionLoadscaninvnEntity.setOneClick(1);
distributionLoadscaninvnEntity.setInventoryPackageId(disStockListDetailEntities.get(0).getId());
distributionLoadscaninvnEntity.setLoadedNub(disStockListDetailEntities.get(0).getNum()); distributionLoadscaninvnEntity.setLoadedNub(disStockListDetailEntities.get(0).getNum());
distributionLoadscaninvnEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); distributionLoadscaninvnEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId());
distributionLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.zhengchang.getValue()); distributionLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.zhengchang.getValue());
@ -2332,7 +2338,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//判断当前登录人是否为司机 //判断当前登录人是否为司机
List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>(); List<DistributionAppDeliveryListVO> distributionAppDeliveryListVOS = new ArrayList<>();
boolean delivery = false; boolean delivery = false;
String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); String value1 = DictBizCache.getValue("role_class", "delivery_driver");
if (roleId.contains(value1)) delivery = true; if (roleId.contains(value1)) delivery = true;

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

@ -176,35 +176,36 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// } // }
// queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId()); // queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId());
DistributionSignforVO distributionSignforVO = JSON.parseObject(JSON.toJSONString(distributionSignfor), DistributionSignforVO.class); DistributionSignforVO distributionSignforVO = JSON.parseObject(JSON.toJSONString(distributionSignfor), DistributionSignforVO.class);
if(ObjectUtils.isNotNull(o)){ if (ObjectUtils.isNotNull(o)) {
String id= (String) o; String id = (String) o;
String[] split = id.split(","); String[] split = id.split(",");
distributionSignforVO.setIds(Arrays.asList(split)); distributionSignforVO.setIds(Arrays.asList(split));
} }
List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignforOwn(distributionSignforVO); List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignforOwn(distributionSignforVO);
List<DistributionSignforExcel> list = new ArrayList<>(); List<DistributionSignforExcel> list = new ArrayList<>();
distributionSignforList.forEach(d -> { distributionSignforList.forEach(d -> {
// distributionSignfor.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSignfor.getType())); // distributionSignfor.setTypeName(DictCache.getValue(DictEnum.YES_NO, DistributionSignfor.getType()));
DistributionSignforExcel signforExcel = new DistributionSignforExcel(); DistributionSignforExcel signforExcel = new DistributionSignforExcel();
BeanUtils.copyProperties(d,signforExcel); BeanUtils.copyProperties(d, signforExcel);
// signforExcel.setConsignee(); // signforExcel.setConsignee();
String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()); String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType());
signforExcel.setDeliveryTypeName(value); signforExcel.setDeliveryTypeName(value);
String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus()); String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus());
signforExcel.setSigningStatusName(value1); signforExcel.setSigningStatusName(value1);
String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning()); String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning());
signforExcel.setDriverSigningName(value2); signforExcel.setDriverSigningName(value2);
String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType()); String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType());
signforExcel.setDeliveryWayName(value3); signforExcel.setDeliveryWayName(value3);
list.add(signforExcel); list.add(signforExcel);
}); });
return list; return list;
} }
@Override @Override
public List<DistributionSignforOwnExcel> exportDistributionSignforOwn(Map<String, Object> distributionSignfor) { public List<DistributionSignforOwnExcel> exportDistributionSignforOwn(Map<String, Object> distributionSignfor) {
Object o = distributionSignfor.get("ids"); Object o = distributionSignfor.get("ids");
if(ObjectUtils.isNotNull(o)){ if (ObjectUtils.isNotNull(o)) {
distributionSignfor.remove("ids"); distributionSignfor.remove("ids");
} }
// BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); // BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
@ -218,8 +219,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// } // }
// queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId()); // queryWrapper.eq("warehouse_id",myCurrentWarehouse.getId());
DistributionSignforVO distributionSignforVO = JSON.parseObject(JSON.toJSONString(distributionSignfor), DistributionSignforVO.class); DistributionSignforVO distributionSignforVO = JSON.parseObject(JSON.toJSONString(distributionSignfor), DistributionSignforVO.class);
if(ObjectUtils.isNotNull(o)){ if (ObjectUtils.isNotNull(o)) {
String id= (String) o; String id = (String) o;
String[] split = id.split(","); String[] split = id.split(",");
distributionSignforVO.setIds(Arrays.asList(split)); distributionSignforVO.setIds(Arrays.asList(split));
} }
@ -227,21 +228,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignforSigningOwn(distributionSignforVO); List<DistributionSignforVO> distributionSignforList = baseMapper.exportDistributionSignforSigningOwn(distributionSignforVO);
List<DistributionSignforOwnExcel> list = new ArrayList<>(); List<DistributionSignforOwnExcel> list = new ArrayList<>();
distributionSignforList.forEach(d ->{ distributionSignforList.forEach(d -> {
DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel(); DistributionSignforOwnExcel signforExcel = new DistributionSignforOwnExcel();
BeanUtils.copyProperties(d,signforExcel); BeanUtils.copyProperties(d, signforExcel);
String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType()); String value = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_TYPE, d.getDeliveryType());
signforExcel.setDeliveryTypeName(value); signforExcel.setDeliveryTypeName(value);
String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus()); String value1 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getSigningStatus());
signforExcel.setSigningStatusName(value1); signforExcel.setSigningStatusName(value1);
String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning()); String value2 = DictBizCache.getValue(DictBizConstant.DISTRIBUTION_SIGNFOR_STATUS, d.getDriverSigning());
signforExcel.setDriverSigningName(value2); signforExcel.setDriverSigningName(value2);
String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType()); String value3 = DictBizCache.getValue(DictBizConstant.ADD_VALUE_SERVE_TYPE, d.getServeType());
signforExcel.setDeliveryWayName(value3); signforExcel.setDeliveryWayName(value3);
list.add(signforExcel); list.add(signforExcel);
}); });
return list; return list;
} }
@Override @Override
@ -492,7 +493,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// } // }
List<Long> orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); List<Long> orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
if (Func.isNotEmpty(orderIds)){ if (Func.isNotEmpty(orderIds)) {
List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleService.listByIds(orderIds); List<DistributionStockArticleEntity> stockArticleEntities = distributionStockArticleService.listByIds(orderIds);
List<DistributionSignPrintVO> printEntities = baseMapper.selectSignImgsUrl(distributionSignforVO.getReservationId()); List<DistributionSignPrintVO> printEntities = baseMapper.selectSignImgsUrl(distributionSignforVO.getReservationId());
distributionSignforVO.setPrintVOList(printEntities); distributionSignforVO.setPrintVOList(printEntities);
@ -1254,9 +1255,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionStockArticleVO> deliveryStockArticleInfo = distributionDeliveryListMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId()); List<DistributionStockArticleVO> deliveryStockArticleInfo = distributionDeliveryListMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId());
// deliveryStockArticleInfo.forEach(); // deliveryStockArticleInfo.forEach();
List<DistributionReservationEntity> distributionReservationEntities = distributionDeliveryListMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); List<DistributionReservationEntity> distributionReservationEntities = distributionDeliveryListMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId());
distributionReservationEntities.forEach(r->{ distributionReservationEntities.forEach(r -> {
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId()); List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId());
reservationStockarticleEntityList.forEach(rs->{ reservationStockarticleEntityList.forEach(rs -> {
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda()
.eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()) .eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId())
.eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()) .eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId())
@ -1265,9 +1266,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
); );
if (Func.isNotEmpty(loadscanEntityList)){ if (Func.isNotEmpty(loadscanEntityList)) {
int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum();
if (rs.getReservationNum() == loadSum){ if (rs.getReservationNum() == loadSum) {
ordCount.getAndIncrement(); ordCount.getAndIncrement();
} }
} }
@ -1363,6 +1364,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} }
@Override @Override
@Transactional
public R oneclick(DistributionSignforDTO distributionSignfor) { public R oneclick(DistributionSignforDTO distributionSignfor) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) { if (Objects.isNull(myCurrentWarehouse)) {
@ -1399,7 +1401,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//获取计划配送用户司机 //获取计划配送用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignfor.getDeliveryId()); DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignfor.getDeliveryId());
if (Func.isEmpty(distributionDeliveryListEntity)){ if (Func.isEmpty(distributionDeliveryListEntity)) {
log.error("#############deliveryId参数错误:{}", distributionSignfor.getDeliveryId()); log.error("#############deliveryId参数错误:{}", distributionSignfor.getDeliveryId());
return R.fail("服务器正忙~~"); return R.fail("服务器正忙~~");
} }
@ -1426,7 +1428,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return R.fail("签收失败"); return R.fail("签收失败");
} }
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
//处理库存品 //处理库存品
//查询出该客户下的库存品信息 //查询出该客户下的库存品信息
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId()); List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId());
@ -1434,108 +1435,194 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode())); boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode()));
//只要库存品没有进行备货操作则不能进行一件装车操作 //只要库存品没有进行备货操作则不能进行一件装车操作
if (flag) { if (flag) {
//库存品均已备货 for (DisStockListDetailEntity detailEntity : detailEntities) {
List<DisStockListDetailEntity> unLoadingiNventoryList = detailEntities.stream().filter(i -> i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList()); DistributionLoadscaninvnEntity loadscaninvnEntity = distributionLoadscaninvnService.getOne(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
if (Func.isNotEmpty(unLoadingiNventoryList) && unLoadingiNventoryList.size() > 0) { .eq(DistributionLoadscaninvnEntity::getReservationId, detailEntity.getReservationId())
for (DisStockListDetailEntity disStockListDetailEntity : unLoadingiNventoryList) { .eq(DistributionLoadscaninvnEntity::getInventoryId, detailEntity.getStockListId())
// --------------------修改库存品包件装车和签收状态—————————————————————————————————————————— .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode())
disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue()); .eq(DistributionLoadscaninvnEntity::getInventoryPackageId, detailEntity.getId())
disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())
disStockListDetailService.updateById(disStockListDetailEntity); );
if (Func.isNotEmpty(loadscaninvnEntity)) {
DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity(); if (!loadscaninvnEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())){
//存在库存品装车数据,这里进行签收状态修改
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
loadscaninvnEntity.setOneClick(1);
loadscaninvnEntity.setOneQclick(2);
loadscaninvnEntity.setSigningUser(user.getNickName());
loadscaninvnEntity.setSigningUserId(user.getUserId());
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
distributionLoadscaninvnService.updateById(loadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
}
}else {
//不存在装车数据 这里需要进行装车数据的补录
detailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue());
detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
disStockListDetailService.updateById(detailEntity);
DistributionLoadscaninvnEntity newLoadscaninvnEntity = new DistributionLoadscaninvnEntity();
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
loadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); newLoadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
} }
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); newLoadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
} }
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
loadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); newLoadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
} }
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); newLoadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
} }
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); newLoadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
} }
loadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); newLoadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
loadscaninvnEntity.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode()); newLoadscaninvnEntity.setOrderPackageCode(detailEntity.getStockPackageCode());
loadscaninvnEntity.setInventoryId(disStockListDetailEntity.getStockListId()); newLoadscaninvnEntity.setInventoryId(detailEntity.getStockListId());
loadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId()); newLoadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId());
loadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId()); newLoadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId());
loadscaninvnEntity.setScanUser(user.getNickName()); newLoadscaninvnEntity.setInventoryPackageId(detailEntity.getId());
loadscaninvnEntity.setScanTime(new Date()); newLoadscaninvnEntity.setScanUser(user.getNickName());
loadscaninvnEntity.setPackageNub(disStockListDetailEntity.getNum()); newLoadscaninvnEntity.setScanTime(new Date());
loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); newLoadscaninvnEntity.setPackageNub(detailEntity.getNum());
loadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); newLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
loadscaninvnEntity.setScanType("1"); newLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue());
loadscaninvnEntity.setType(2); newLoadscaninvnEntity.setScanType("1");
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); newLoadscaninvnEntity.setType(2);
loadscaninvnEntity.setIsSignfor(1); newLoadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscaninvnEntity.setReceivedQuantity(disStockListDetailEntity.getNum()); newLoadscaninvnEntity.setIsSignfor(1);
loadscaninvnEntity.setOneClick(2); newLoadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
loadscaninvnEntity.setOneQclick(2); newLoadscaninvnEntity.setOneClick(2);
loadscaninvnEntity.setSigningUser(user.getNickName()); newLoadscaninvnEntity.setOneQclick(2);
loadscaninvnEntity.setSigningUserId(user.getUserId()); newLoadscaninvnEntity.setSigningUser(user.getNickName());
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); newLoadscaninvnEntity.setSigningUserId(user.getUserId());
newLoadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
if (distributionSignfor.getIsClerk()) { if (distributionSignfor.getIsClerk()) {
loadscaninvnEntity.setMsg("文员一键签收数据补录"); newLoadscaninvnEntity.setMsg("文员一键签收数据补录");
} else { } else {
loadscaninvnEntity.setMsg("司机一键签收数据补录"); newLoadscaninvnEntity.setMsg("司机一键签收数据补录");
} }
distributionLoadscaninvnService.save(loadscaninvnEntity); distributionLoadscaninvnService.save(newLoadscaninvnEntity);
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
//更新签收表的签收数量和装车数量 //更新签收表的签收数量和装车数量
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); Integer j = distributionSignforMapper.updateLoadAndsignforByinvn(newLoadscaninvnEntity.getDeliveryId(), newLoadscaninvnEntity.getReservationId(), newLoadscaninvnEntity.getPackageNub());
//维护预约库存品数据 //维护预约库存品数据
//扣减库存 //扣减库存
DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId()); DistributionStockListEntity stockListEntity = distributionStockListService.getById(detailEntity.getStockListId());
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub()); stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - newLoadscaninvnEntity.getPackageNub());
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub()); stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - newLoadscaninvnEntity.getPackageNub());
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub()); stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + newLoadscaninvnEntity.getPackageNub());
distributionStockListService.updateById(stockListEntity); distributionStockListService.updateById(stockListEntity);
} }
} }
//库存品扫描记录补充
for (DisStockListDetailEntity detailEntity : detailEntities) {
if (detailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())) { // //库存品均已备货
detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue()); // List<DisStockListDetailEntity> unLoadingiNventoryList = detailEntities.stream().filter(i -> i.getStockLockingStatus().equals(InventoryLoadingStatusConstant.weizhuangche.getValue())).collect(Collectors.toList());
disStockListDetailService.updateById(detailEntity); // if (Func.isNotEmpty(unLoadingiNventoryList) && unLoadingiNventoryList.size() > 0) {
//查询出对于的装车扫描记录 // for (DisStockListDetailEntity disStockListDetailEntity : unLoadingiNventoryList) {
List<DistributionLoadscaninvnEntity> list = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda() //// --------------------修改库存品包件装车和签收状态——————————————————————————————————————————
.eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionSignfor.getDeliveryId()) // disStockListDetailEntity.setStockLockingStatus(InventoryLoadingStatusConstant.yizhuangche.getValue());
.eq(DistributionLoadscaninvnEntity::getReservationId, distributionSignfor.getReservationId()) // disStockListDetailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode()) // disStockListDetailService.updateById(disStockListDetailEntity);
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); //
if (list.size() == 1) { // DistributionLoadscaninvnEntity loadscaninvnEntity = new DistributionLoadscaninvnEntity();
//正常进行扫描记录签收修改 // if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) {
DistributionLoadscaninvnEntity loadscaninvnEntity = list.get(0); // loadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
if (distributionSignfor.getIsClerk()) { // }
loadscaninvnEntity.setMsg("文员一键签收数据补录"); // if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) {
} else { // loadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
loadscaninvnEntity.setMsg("司机一键签收数据补录"); // }
} // if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) {
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); // loadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); // }
loadscaninvnEntity.setOneClick(1); // if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) {
loadscaninvnEntity.setOneQclick(2); // loadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
loadscaninvnEntity.setSigningUser(user.getUserName()); // }
loadscaninvnEntity.setSigningUserId(user.getUserId()); // if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) {
loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum()); // loadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date())); // }
distributionLoadscaninvnService.updateById(loadscaninvnEntity); // loadscaninvnEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString());
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId()); // loadscaninvnEntity.setOrderPackageCode(disStockListDetailEntity.getStockPackageCode());
Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub()); // loadscaninvnEntity.setInventoryId(disStockListDetailEntity.getStockListId());
} else { // loadscaninvnEntity.setDeliveryId(distributionSignforEntity.getDeliveryId());
log.error("################库存品未进行备货操作+{}" + list); // loadscaninvnEntity.setReservationId(distributionSignforEntity.getReservationId());
//此时说明在同一配送任务下,同一客户出现了相同的库存品包件码 // loadscaninvnEntity.setScanUser(user.getNickName());
} // loadscaninvnEntity.setScanTime(new Date());
} // loadscaninvnEntity.setPackageNub(disStockListDetailEntity.getNum());
//对库存品包件上级的状态维护 // loadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue());
distributionAsyncService.checkStockArticleListSigningStatus(detailEntity); // loadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue());
} // loadscaninvnEntity.setScanType("1");
// loadscaninvnEntity.setType(2);
// loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscaninvnEntity.setIsSignfor(1);
// loadscaninvnEntity.setReceivedQuantity(disStockListDetailEntity.getNum());
// loadscaninvnEntity.setOneClick(2);
// loadscaninvnEntity.setOneQclick(2);
// loadscaninvnEntity.setSigningUser(user.getNickName());
// loadscaninvnEntity.setSigningUserId(user.getUserId());
// loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
//
// if (distributionSignfor.getIsClerk()) {
// loadscaninvnEntity.setMsg("文员一键签收数据补录");
// } else {
// loadscaninvnEntity.setMsg("司机一键签收数据补录");
// }
// distributionLoadscaninvnService.save(loadscaninvnEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// //更新签收表的签收数量和装车数量
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// //维护预约库存品数据
// //扣减库存
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(disStockListDetailEntity.getStockListId());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - loadscaninvnEntity.getPackageNub());
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + loadscaninvnEntity.getPackageNub());
// distributionStockListService.updateById(stockListEntity);
// }
// }
// //库存品扫描记录补充
// for (DisStockListDetailEntity detailEntity : detailEntities) {
// if (detailEntity.getStockLockingStatus().equals(InventoryLoadingStatusConstant.yizhuangche.getValue())) {
// detailEntity.setStockSignfoStatus(InventorySigningStatusConstant.yiqianshou.getValue());
// disStockListDetailService.updateById(detailEntity);
// //查询出对于的装车扫描记录
// List<DistributionLoadscaninvnEntity> list = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
// .eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionSignfor.getDeliveryId())
// .eq(DistributionLoadscaninvnEntity::getReservationId, distributionSignfor.getReservationId())
// .eq(DistributionLoadscaninvnEntity::getOrderPackageCode, detailEntity.getStockPackageCode())
// .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
// if (list.size() == 1) {
// //正常进行扫描记录签收修改
// DistributionLoadscaninvnEntity loadscaninvnEntity = list.get(0);
// if (distributionSignfor.getIsClerk()) {
// loadscaninvnEntity.setMsg("文员一键签收数据补录");
// } else {
// loadscaninvnEntity.setMsg("司机一键签收数据补录");
// }
// loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
// loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
// loadscaninvnEntity.setOneClick(1);
// loadscaninvnEntity.setOneQclick(2);
// loadscaninvnEntity.setSigningUser(user.getUserName());
// loadscaninvnEntity.setSigningUserId(user.getUserId());
// loadscaninvnEntity.setReceivedQuantity(detailEntity.getNum());
// loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
// distributionLoadscaninvnService.updateById(loadscaninvnEntity);
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distributionDeliveryListEntity.getId());
// Integer j = distributionSignforMapper.updatesignforByinvn(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getPackageNub());
// } else {
// log.error("################库存品未进行备货操作+{}" + list);
// //此时说明在同一配送任务下,同一客户出现了相同的库存品包件码
// }
// }
// //对库存品包件上级的状态维护
// distributionAsyncService.checkStockArticleListSigningStatus(detailEntity);
// }
} else { } else {
log.error("################库存品未进行备货操作+{}" + detailEntities); log.error("################库存品未进行备货操作+{}" + detailEntities);
return R.fail("一键装车失败!!!库存品都备货了!?"); return R.fail("一键装车失败!!!库存品都备货了!?");
@ -2222,22 +2309,22 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
switch (conditions) { switch (conditions) {
case 1: case 1:
//订制品 //订制品
DistributionAddvaluePackageVO addvaluePackageVO = distributionAddvalueMapper.selectAddvaluePackageDetail(p.getPackageId(),distributionAddvalueDTO.getAddvalueId(),distributionAddvalueDTO.getReservationId()); DistributionAddvaluePackageVO addvaluePackageVO = distributionAddvalueMapper.selectAddvaluePackageDetail(p.getPackageId(), distributionAddvalueDTO.getAddvalueId(), distributionAddvalueDTO.getReservationId());
if (Func.isNotEmpty(addvaluePackageVO)){ if (Func.isNotEmpty(addvaluePackageVO)) {
addvaluePackageVOS.add(addvaluePackageVO); addvaluePackageVOS.add(addvaluePackageVO);
} }
break; break;
case 2: case 2:
DistributionAddvaluePackageVO addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageDetail(p.getPackageId(),distributionAddvalueDTO.getAddvalueId(),distributionAddvalueDTO.getReservationId()); DistributionAddvaluePackageVO addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageDetail(p.getPackageId(), distributionAddvalueDTO.getAddvalueId(), distributionAddvalueDTO.getReservationId());
//库存品 //库存品
if (Func.isNotEmpty(addvalueinventoryPackageVO)){ if (Func.isNotEmpty(addvalueinventoryPackageVO)) {
addvaluePackageVOS.add(addvalueinventoryPackageVO); addvaluePackageVOS.add(addvalueinventoryPackageVO);
} }
break; break;
case 3: case 3:
DistributionAddvaluePackageVO addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageDetail(p.getPackageId(),distributionAddvalueDTO.getAddvalueId(),distributionAddvalueDTO.getReservationId()); DistributionAddvaluePackageVO addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageDetail(p.getPackageId(), distributionAddvalueDTO.getAddvalueId(), distributionAddvalueDTO.getReservationId());
//库存品 //库存品
if (Func.isNotEmpty(addvalueZeroPackageVO)){ if (Func.isNotEmpty(addvalueZeroPackageVO)) {
addvaluePackageVOS.add(addvalueZeroPackageVO); addvaluePackageVOS.add(addvalueZeroPackageVO);
} }
break; break;
@ -2640,7 +2727,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntityList.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntityList.getReservationId())); DistributionSignforEntity signforEntity = distributionSignforMapper.selectOne(Wrappers.<DistributionSignforEntity>query().lambda().eq(DistributionSignforEntity::getDeliveryId, loadscanEntityList.getDeliveryId()).eq(DistributionSignforEntity::getReservationId, loadscanEntityList.getReservationId()));
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber());
BigDecimal signingNumber = new BigDecimal(signforEntity.getReceivedQuantity()); BigDecimal signingNumber = new BigDecimal(signforEntity.getReceivedQuantity());
if (loadscanEntityList.getLoadedNub() < p.getSigningNum()){ if (loadscanEntityList.getLoadedNub() < p.getSigningNum()) {
//这里需要同时维护装车和签收数量 //这里需要同时维护装车和签收数量
// loadscanEntityList.setLoadedNub(p.getSigningNum()); // loadscanEntityList.setLoadedNub(p.getSigningNum());
// loadscanEntityList.setPackageNub(p.getSigningNum()); // loadscanEntityList.setPackageNub(p.getSigningNum());
@ -2746,49 +2833,49 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} }
@Override @Override
public IPage<DistributionAddvaluePackageVO> checkAddValuePackageList(IPage<DistributionAddvaluePackageVO> page,Map<String, Object> addValueDTO) { public IPage<DistributionAddvaluePackageVO> checkAddValuePackageList(IPage<DistributionAddvaluePackageVO> page, Map<String, Object> addValueDTO) {
String reservationId = (String) addValueDTO.get("reservationId"); String reservationId = (String) addValueDTO.get("reservationId");
if (Func.isEmpty(reservationId)){ if (Func.isEmpty(reservationId)) {
log.error("##################无reservationId"); log.error("##################无reservationId");
return null; return null;
} }
List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(Long.parseLong(reservationId)); List<DistributionReservationStockarticleEntity> reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(Long.parseLong(reservationId));
List<DistributionAddvaluePackageVO> addvaluePackageVOS = new ArrayList<>(); List<DistributionAddvaluePackageVO> addvaluePackageVOS = new ArrayList<>();
if (Func.isNotEmpty(reservationStockarticleEntityList)){ if (Func.isNotEmpty(reservationStockarticleEntityList)) {
List<Long> orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); List<Long> orderIds = reservationStockarticleEntityList.stream().map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList());
LambdaQueryWrapper<DistributionStockArticleEntity> orderQW = Wrappers.<DistributionStockArticleEntity>query().lambda().in(DistributionStockArticleEntity::getId, orderIds); LambdaQueryWrapper<DistributionStockArticleEntity> orderQW = Wrappers.<DistributionStockArticleEntity>query().lambda().in(DistributionStockArticleEntity::getId, orderIds);
if (Func.isNotEmpty(addValueDTO.get("orderCode"))){ if (Func.isNotEmpty(addValueDTO.get("orderCode"))) {
orderQW.like(DistributionStockArticleEntity::getOrderCode, addValueDTO.get("orderCode")); orderQW.like(DistributionStockArticleEntity::getOrderCode, addValueDTO.get("orderCode"));
} }
List<DistributionStockArticleEntity> orderList = distributionStockArticleService.list(orderQW); List<DistributionStockArticleEntity> orderList = distributionStockArticleService.list(orderQW);
orderList.forEach(rs->{ orderList.forEach(rs -> {
if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())){ if (rs.getIsZero().equals(IsOrNoConstant.no.getValue())) {
List<DistributionAddvaluePackageVO> addvaluepackageVO = distributionAddvalueMapper.selectAddvaluePackageVO(Long.parseLong(reservationId),rs.getId(),addValueDTO); List<DistributionAddvaluePackageVO> addvaluepackageVO = distributionAddvalueMapper.selectAddvaluePackageVO(Long.parseLong(reservationId), rs.getId(), addValueDTO);
if (Func.isNotEmpty(addvaluepackageVO)){ if (Func.isNotEmpty(addvaluepackageVO)) {
addvaluePackageVOS.addAll(addvaluepackageVO); addvaluePackageVOS.addAll(addvaluepackageVO);
} }
}else { } else {
List<DistributionAddvaluePackageVO> addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageVO(Long.parseLong(reservationId),rs.getId(),addValueDTO); List<DistributionAddvaluePackageVO> addvalueZeroPackageVO = distributionAddvalueMapper.selectAddvalueZeroPackageVO(Long.parseLong(reservationId), rs.getId(), addValueDTO);
if (Func.isNotEmpty(addvalueZeroPackageVO)){ if (Func.isNotEmpty(addvalueZeroPackageVO)) {
addvaluePackageVOS.addAll(addvalueZeroPackageVO); addvaluePackageVOS.addAll(addvalueZeroPackageVO);
} }
} }
}); });
} }
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(Long.parseLong(reservationId)); List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(Long.parseLong(reservationId));
if (Func.isNotEmpty(distributionReservationStocklistEntities)){ if (Func.isNotEmpty(distributionReservationStocklistEntities)) {
List<Long> inventoryIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList()); List<Long> inventoryIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList());
LambdaQueryWrapper<DistributionStockListEntity> inventoryQW = Wrappers.<DistributionStockListEntity>query().lambda().in(DistributionStockListEntity::getId, inventoryIds); LambdaQueryWrapper<DistributionStockListEntity> inventoryQW = Wrappers.<DistributionStockListEntity>query().lambda().in(DistributionStockListEntity::getId, inventoryIds);
if (Func.isNotEmpty(addValueDTO.get("materialName"))){ if (Func.isNotEmpty(addValueDTO.get("materialName"))) {
inventoryQW.like(DistributionStockListEntity::getDescriptionGoods,addValueDTO.get("materialName")); inventoryQW.like(DistributionStockListEntity::getDescriptionGoods, addValueDTO.get("materialName"));
} }
if (Func.isNotEmpty(addValueDTO.get("materialCode"))){ if (Func.isNotEmpty(addValueDTO.get("materialCode"))) {
inventoryQW.like(DistributionStockListEntity::getCargoNumber,addValueDTO.get("materialCode")); inventoryQW.like(DistributionStockListEntity::getCargoNumber, addValueDTO.get("materialCode"));
} }
List<DistributionStockListEntity> stockListEntityList = distributionStockListService.list(inventoryQW); List<DistributionStockListEntity> stockListEntityList = distributionStockListService.list(inventoryQW);
stockListEntityList.forEach(inven->{ stockListEntityList.forEach(inven -> {
List<DistributionAddvaluePackageVO> addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageVO(Long.parseLong(reservationId),inven.getId(),addValueDTO); List<DistributionAddvaluePackageVO> addvalueinventoryPackageVO = distributionAddvalueMapper.selectAddvalueInventoryPackageVO(Long.parseLong(reservationId), inven.getId(), addValueDTO);
if (Func.isNotEmpty(addvalueinventoryPackageVO)){ if (Func.isNotEmpty(addvalueinventoryPackageVO)) {
addvaluePackageVOS.addAll(addvalueinventoryPackageVO); addvaluePackageVOS.addAll(addvalueinventoryPackageVO);
} }
}); });

Loading…
Cancel
Save