Browse Source

Merge branch 'dev' into pre-production

# Conflicts:
#	blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/ZbFactoryAccountsInterceptor.java
newStockUp
zhenghaoyu 2 years ago
parent
commit
439883060e
  1. 46
      blade-biz-common/src/main/java/org/springblade/common/constant/Inventory/InventoryPackageStatusConstant.java
  2. 10
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DisStockListDetailEntity.java
  3. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java
  4. 2
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSignforEntity.java
  5. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java
  6. 48
      blade-service/logpm-basicdata/src/test/java/com/logpm/basicdata/TestService.java
  7. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  8. 36
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml
  9. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  10. 164
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  11. 46
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  12. 3
      blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/ZbFactoryAccountsInterceptor.java

46
blade-biz-common/src/main/java/org/springblade/common/constant/Inventory/InventoryPackageStatusConstant.java

@ -0,0 +1,46 @@
package org.springblade.common.constant.Inventory;
/**
* 库存品绑定状态
* 关联码表 order_package_status
*
* @author pref
*/
public enum InventoryPackageStatusConstant {
zhengchang("正常", "1"),
quxiao("取消", "2"),
xinzneg("新增", "3");
/**
* 状态
*/
private String name;
/**
*
*/
private String value;
private InventoryPackageStatusConstant(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

10
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DisStockListDetailEntity.java

@ -91,7 +91,15 @@ public class DisStockListDetailEntity extends TenantEntity {
* 预约库存品中间表Id
*/
@ApiModelProperty(value = "预约库存品中间表Id")
private Long reservationStockListId;
private Long reservationId;
/**
* 库存品状态1-正常2-取消3-新增
*/
@ApiModelProperty(value = "库存品状态;1-正常、2-取消、3-新增")
private String stockPackageStatus;
/**
* 预留1
*/

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java

@ -74,7 +74,7 @@ public class DistributionDeliveryListEntity extends TenantEntity {
* 仓库id
*/
@ApiModelProperty(value = "仓库id")
private String warehouseId;
private Long warehouseId;
/**
* 仓库名称
*/

2
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionSignforEntity.java

@ -127,7 +127,7 @@ public class DistributionSignforEntity extends TenantEntity {
* 配送仓库(id)
*/
@ApiModelProperty(value = "配送仓库(id)")
private String warehouseId;
private Long warehouseId;
/**
* 配送仓库(名称)
*/

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockArticleVO.java

@ -136,6 +136,11 @@ public class DistributionStockArticleVO extends DistributionStockArticleEntity {
*/
@ApiModelProperty(value = "备货数量")
private String stockupNumber;
/**
* ids
*/
@ApiModelProperty(value = "ids")
private List<Long> warehouseIdList;

48
blade-service/logpm-basicdata/src/test/java/com/logpm/basicdata/TestService.java

@ -0,0 +1,48 @@
//package com.logpm.basicdata;
//
//import com.alibaba.fastjson.JSONObject;
//import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
//import com.logpm.basicdata.service.IBasicdataWarehouseService;
//import org.junit.jupiter.api.Test;
//import org.junit.jupiter.api.extension.ExtendWith;
//import org.springblade.common.cache.CacheNames;
//import org.springblade.core.redis.cache.BladeRedis;
//import org.springblade.core.test.BladeBootTest;
//import org.springblade.core.test.BladeSpringExtension;
//import org.springframework.beans.factory.annotation.Autowired;
//
//import java.io.IOException;
//
//@ExtendWith(BladeSpringExtension.class)
//@BladeBootTest(appName = "logpm-basicdata-zhy", enableLoader = true)
//public class TestService {
//
// @Autowired
// private BladeRedis bladeRedis;
// @Autowired
// private IBasicdataWarehouseService basicdataWarehouseService;
//
//
// @Test
// public void test3() throws IOException {
//
// BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseService.getById(1684441029670547458L);
//
//// bladeRedis.setEx(CacheNames.tenantKeyObj("627683", CacheNames.USER_WAREHOUSE_KEY, "1649331096967450625"), JSONObject.toJSONString(warehouseEntity), 30 * 24 * 60 * 60L);
//
//// Object o = bladeRedis.get("627683:logpm:user:warehouse:select:1649331096967450625");
//
//
//// bladeRedis.setEx(CacheNames.tenantKeyObj("627683111", CacheNames.USER_WAREHOUSE_KEY, "1649331096967450625"), ProtostuffUtil.serialize(warehouseEntity), 30 * 24 * 60 * 60L);
//// Object o = bladeRedis.get("627683111:logpm:user:warehouse:select:1649331096967450625");
//
// JSONObject jsonObject = new JSONObject();
// jsonObject.put("name","xiaob");
// jsonObject.put("age",23);
//
// bladeRedis.setEx(CacheNames.tenantKeyObj("627683", CacheNames.USER_WAREHOUSE_KEY, "1649331096967450625"), jsonObject.toJSONString(), 30 * 24 * 60 * 60L);
//
// System.out.println(111);
// }
//
//}

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

@ -252,7 +252,12 @@ public class DistributionStockArticleController extends BladeController {
@ApiOperation(value = "分页", notes = "传入distributionStockArticle")
public R<IPage<DistributionStockArticleVO>> clientList(@ApiIgnore DistributionStockArticleVO distributionStockArticle, Query query) {
//获取当前登录人仓库
// List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
// List<Long> collect = myWatchWarehouse.stream()
// .map(BasicdataWarehouseEntity::getId)
// .collect(Collectors.toList());
// distributionStockArticle.setWarehouseIdList(collect);
IPage<DistributionStockArticleEntity> pages = distributionStockArticleService.selectClientListPage(Condition.getPage(query), distributionStockArticle);
DistributionStockArticleWrapper.build().pageVO(pages);

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

@ -270,6 +270,12 @@
<if test="param.trainNumber != null and param.trainNumber!=''">
and lddl.train_number like concat('%',#{param.trainNumber},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and lddl.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
@ -312,6 +318,12 @@
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and ldr.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
@ -348,6 +360,12 @@
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and lddl.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
@ -391,6 +409,12 @@
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and lddl.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>
@ -755,6 +779,12 @@
<if test="param.warehouseName != null and param.warehouseName!=''">
and lddl.warehouse_name like concat('%',#{param.warehouseName},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and ldr.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
@ -797,6 +827,12 @@
<if test="param.vehicleName != null and param.vehicleName!=''">
and lddl.vehicle_name like concat('%',#{param.vehicleName},'%')
</if>
<if test="param.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(param.warehouseIdList)">
and ldr.warehouse_id in
<foreach collection="param.warehouseIdList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="param.driverName != null and param.driverName!=''">
and lddl.driver_name like concat('%',#{param.driverName},'%')
</if>

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -91,6 +91,12 @@
<if test="distributionStockArticleVO.reservationStatus != null and distributionStockArticleVO.reservationStatus != ''">
and ldsa.reservation_status = #{distributionStockArticleVO.reservationStatus}
</if>
<!-- <if test="distributionStockArticleVO.warehouseIdList != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(distributionStockArticleVO.warehouseIdList)">-->
<!-- and ldsa.warehouse_id in-->
<!-- <foreach collection="distributionStockArticleVO.warehouseIdList" item="item" open="(" close=")" separator=",">-->
<!-- #{item}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="distributionStockArticleVO.orderStatus != null and distributionStockArticleVO.orderStatus != ''">
and ldsa.order_status = #{distributionStockArticleVO.orderStatus}
</if>

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

@ -48,6 +48,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang.StringUtils;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryPackageStatusConstant;
import org.springblade.common.constant.delivery.DeliveryLoadingStatusConstant;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.loading.LoadingStatusConstant;
@ -128,6 +129,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
private final IDictBizClient dictBizClient;
private final IBasicdataDriverArteryClient iBasicdataDriverArteryClient;
private final IBasicdataWarehouseClient warehouseClient;
private final IDisStockListDetailService disStockListDetailService;
@Override
public IPage<DistributionDeliveryListEntity> selectDistributionDeliveryListPage(IPage<DistributionDeliveryListEntity> page, DistributionDeliveryListDTO distributionDeliveryList) {
@ -225,7 +227,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
distributionDeliveryList.setCreateTime_query(sdf.format(distributionDeliveryList.getCreateTime()));
}
//获取当前登录人仓库
List<BasicdataWarehouseEntity> myWatchWarehouse = warehouseClient.getMyWatchWarehouse();
//取出id
List<Long> collect = myWatchWarehouse.stream().map(BasicdataWarehouseEntity::getId).collect(Collectors.toList());
distributionDeliveryList.setWarehouseIdList(collect);
DistributionstatisticsnmbVO distributionstatisticsnmbVO = new DistributionstatisticsnmbVO();
//商配车次
Integer a = baseMapper.selectBycommercialNub(distributionDeliveryList);
@ -997,6 +1003,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.success("成功");
}
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
@Override
public R oneack(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//获取当前用户司机
@ -1017,6 +1025,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
}
@Override
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
public R loadingscanoff(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//查询是否重复扫码
@ -1112,6 +1121,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.success("成功");
}
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
@Override
public R loadinginventory(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//库存品
@ -1129,55 +1139,117 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//根据传递进来的库存品条码进行库存品的校验
//获取之前的
String barcode = distrilbutionloadingscanDTO.getBarcode();
//查询是否重复扫描
List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
.eq(DistributionLoadscaninvnEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()));
if (distributionLoadscaninvnEntities.size()>0 ){
return R.fail("重复扫描");
}
//这里就需要将此库存品和计划中的进行校验,如果此时无法从
//查询出该客户下的所有库存品包件信息
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda().eq(DisStockListDetailEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()));
if ( list.size() < 0 ){
return R.fail("无效包条!!");
}
//1、不存在这个客户的库存品列表中,串货
List<DisStockListDetailEntity> disStockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId())
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode()));
if (disStockListDetailEntities.size() == 1){
//这里就需要插入库存品扫描信息
ArrayList<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntityArrayList = new ArrayList<>();
for (int i = 0; i < disStockListDetailEntities.size(); i++) {
//依次插入该装车记录,设置车辆
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = new DistributionLoadscaninvnEntity();
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscaninvnEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
distributionLoadscaninvnEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscaninvnEntity.setScanStatus(2);
distributionLoadscaninvnEntity.setScanType("1");
distributionLoadscaninvnEntity.setScanTime(new Date());
distributionLoadscaninvnEntity.setOrderPackageCode(disStockListDetailEntities.get(i).getStockPackageCode());
if (null == distributionLoadscaninvnEntity.getPackageNub()) {
distributionLoadscaninvnEntity.setPackageNub(1);
}
distributionLoadscaninvnEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscaninvnEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscaninvnEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscaninvnEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer a = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getPackageNub());
distributionLoadscaninvnEntityArrayList.add(distributionLoadscaninvnEntity);
}
b = distributionLoadscaninvnService.saveBatch(distributionLoadscaninvnEntityArrayList);
}else {
return R.fail("重复包条码!!");
}
//2、不存在这个车次中无效包条码
//3、重复扫码
// if (distrilbutionloadingscanDTO.getInventorytype() == 3) {
//无拆包
List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = new ArrayList<>();
// distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnScan(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
// if (distributionLoadscanvnEntities.size() <= 0) {
//拆包从备货查询
distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnScanStock(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
// if (distributionLoadscanvnEntities.size() <= 0) {
// return R.fail(3001, "窜货");
// }
// // if (distrilbutionloadingscanDTO.getInventorytype() == 3) {
// //无拆包
// List<DistributionLoadscaninvnEntity> distributionLoadscanvnEntities = new ArrayList<>();
//// distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnScan(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId());
//// if (distributionLoadscanvnEntities.size() <= 0) {
// //拆包从备货查询
// distributionLoadscanvnEntities = baseMapper.selectdeliveryworkVnScanStock(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getReservationId(), distrilbutionloadingscanDTO.getDeliveryId());
//// if (distributionLoadscanvnEntities.size() <= 0) {
//// return R.fail(3001, "窜货");
//// }
//// }
// for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
// //查询是否重复扫码
//// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
//// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
//// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
//// .ne(DistributionLoadscanEntity::getScanStatus, 1)
//// );
//// if (distributionLoadscanEntitiesflag.size() > 0) {
//// return R.fail(3002, "重复货物");
//// }
// //依次插入该装车记录,设置车辆
// if (null != distributionDeliverySelfEntity.getDriverId()) {
// distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
// }
for (DistributionLoadscaninvnEntity distributionLoadscanEntity : distributionLoadscanvnEntities) {
//查询是否重复扫码
// List<DistributionLoadscanEntity> distributionLoadscanEntitiesflag = distributionLoadscanMapper.selectList(new QueryWrapper<DistributionLoadscanEntity>().lambda()
// .eq(DistributionLoadscanEntity::getDeliveryId, distributionLoadscanEntity.getReservationId())
// .eq(DistributionLoadscanEntity::getOrderPackageCode, distributionLoadscanEntity.getOrderPackageCode())
// .ne(DistributionLoadscanEntity::getScanStatus, 1)
// );
// if (distributionLoadscanEntitiesflag.size() > 0) {
// return R.fail(3002, "重复货物");
// distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
// distributionLoadscanEntity.setScanStatus(2);
// distributionLoadscanEntity.setScanType("1");
// distributionLoadscanEntity.setScanTime(new Date());
// if (null == distributionLoadscanEntity.getPackageNub()) {
// distributionLoadscanEntity.setPackageNub(1);
// }
//依次插入该装车记录,设置车辆
if (null != distributionDeliverySelfEntity.getDriverId()) {
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId());
}
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName());
distributionLoadscanEntity.setScanStatus(2);
distributionLoadscanEntity.setScanType("1");
distributionLoadscanEntity.setScanTime(new Date());
if (null == distributionLoadscanEntity.getPackageNub()) {
distributionLoadscanEntity.setPackageNub(1);
}
distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
if (null != distributionDeliverySelfEntity.getDriverPhone()) {
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
}
if (null != distributionDeliverySelfEntity.getVehicleId()) {
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
}
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
}
b = distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
// } else if (distrilbutionloadingscanDTO.getInventorytype() == 1) {
// distributionLoadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
// distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub());
// if (null != distributionDeliverySelfEntity.getDriverPhone()) {
// distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone());
// }
// if (null != distributionDeliverySelfEntity.getVehicleId()) {
// distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId());
// }
// //查询本车次是否第一次扫码,没有则更新上车时间
// Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
// //更新签收表的装车数量
// Integer j = distributionSignforMapper.updateloadByinvn(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub());
// }
// b = distributionLoadscaninvnService.saveBatch(distributionLoadscanvnEntities);
//// } else if (distrilbutionloadingscanDTO.getInventorytype() == 1) {
// //TODO 库存品手动输入
//
// }

46
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -39,10 +39,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.Inventory.InventoryBindingStatusConstant;
import org.springblade.common.constant.Inventory.InventoryLoadingStatusConstant;
import org.springblade.common.constant.Inventory.InventorySigningStatusConstant;
import org.springblade.common.constant.Inventory.InventoryTypeConstant;
import org.springblade.common.constant.Inventory.*;
import org.springblade.common.constant.delivery.DeliveryStatusConstant;
import org.springblade.common.constant.order.OrderReservationStatusConstant;
import org.springblade.common.constant.orderpackage.OrderPackageFreezeStatusConstant;
@ -392,8 +389,6 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
if (Func.isNotBlank(i.getOrderCode())) {
orderNumber.add(i.getOrderCode());
}
Integer quantityOccupied = i.getQuantityOccupied();
i.setQuantityOccupied(quantityOccupied + i.getReservationNum());
distributionStockListService.updateById(i);
@ -416,7 +411,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationStocklistService.save(distributionReservationStocklistEntity);
stockListCount.getAndAdd(distributionReservationStocklistEntity.getReservationNum());
List<DisStockListDetailEntity> detailEntities = new ArrayList<>();
for (int j = 0; j < quantityOccupied; j++) {
for (int j = 0; j < i.getReservationNum(); j++) {
//构建库存品
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity();
disStockListDetailEntity.setNum(1);
@ -428,7 +423,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue());
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId());
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName());
disStockListDetailEntity.setReservationStockListId(distributionReservationStocklistEntity.getId());
disStockListDetailEntity.setReservationId(reservationId);
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.zhengchang.getValue());
detailEntities.add(disStockListDetailEntity);
}
//完成库存品详情的添加
@ -859,6 +855,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setDriverName(driverNames.deleteCharAt(driverNames.length() - 1).toString());
distributionDeliveryListEntity.setVehicleName(vehicleNubs.deleteCharAt(vehicleNubs.length() - 1).toString());
}
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionDeliveryListEntity.setWarehouseName(String.join(",", warehouseNames));
distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.daipeisong.getValue());
distributionDeliveryListEntity.setCustomersNumber(reservationIds.split(",").length);
@ -1104,8 +1101,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue());
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId());
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName());
disStockListDetailEntity.setReservationStockListId(reservationStocklistEntity.getId());
disStockListDetailEntity.setReservationId(id);
detailEntities.add(disStockListDetailEntity);
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.xinzneg.getValue());
}
//完成库存品详情的添加
disStockListDetailService.saveBatch(detailEntities);
@ -1119,8 +1117,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
Integer newReservationNum = distributionStockListDTO.getReservationNum();
if (oldReservationNum > newReservationNum){
//对应库存品减少
}else {
//查询出对应的库存品信息,进行取消状态标识
int count = oldReservationNum - newReservationNum;
List<DisStockListDetailEntity> disStockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, id)
.eq(DisStockListDetailEntity::getStockListId,distributionReservationStocklistEntity.getStocklistId())
.ne(DisStockListDetailEntity::getStockLockingStatus, InventoryPackageStatusConstant.quxiao.getValue()));
for (int i = 0; i < count; i++) {
DisStockListDetailEntity disStockListDetailEntity = disStockListDetailEntities.get(i);
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.quxiao.getValue());
disStockListDetailService.updateById(disStockListDetailEntity);
}
}else {
int count =newReservationNum - oldReservationNum ;
List<DisStockListDetailEntity> detailEntities = new ArrayList<>();
for (int i = 0; i < count; i++) {
//构建库存品
@ -1134,11 +1143,12 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue());
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId());
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName());
disStockListDetailEntity.setReservationStockListId(reservationStocklistEntity.getId());
disStockListDetailEntity.setReservationId(id);
detailEntities.add(disStockListDetailEntity);
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.xinzneg.getValue());
//完成库存品详情的添加
disStockListDetailService.saveBatch(detailEntities);
}
disStockListDetailService.saveBatch(detailEntities);
//对应库存品增加
}
DistributionStockListEntity stockListEntity = distributionStockListService.getById(distributionReservationStocklistEntity.getStocklistId());
@ -1168,6 +1178,8 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionStockListEntity.setQuantityOccupied(newQuantityOccupied);
distributionStockListService.updateById(distributionStockListEntity);
disStockListDetailMapper.deleteByReservationStockListId(distributionReservationStocklistEntity.getId());
//TODO 删除库存品包件信息
});
DistributionReservationEntity reservationEntity = this.getById(id);
Integer reservationNum = reservationEntity.getReservationNum();
@ -1201,6 +1213,10 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
log.error("参数异常allocationDTO+{" + allocationDTO + "}");
return R.fail("服务器正忙!!!");
}
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return R.fail("无仓库信息!!!");
}
//1、添加配送任务
DistributionStockupDTO stockup = allocationDTO.getStockup();
DistributionStockupEntity stockupEntity = Func.copy(stockup, DistributionStockupEntity.class);
@ -1464,6 +1480,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionDeliveryListEntity.setDeliveryNumber(deliveryPackageTotal.get());
distributionDeliveryListEntity.setNoteNumber(Func.random(13, RandomType.INT));
distributionDeliveryListEntity.setCustomersNumber(clientTotal.get());
distributionDeliveryListEntity.setWarehouseId(myCurrentWarehouse.getId());
distributionDeliveryListService.updateById(distributionDeliveryListEntity);
return R.status(true);
}
@ -1964,7 +1981,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
distributionReservationStocklistService.save(distributionReservationStocklistEntity);
stockListCount.getAndAdd(distributionReservationStocklistEntity.getReservationNum());
List<DisStockListDetailEntity> detailEntities = new ArrayList<>();
for (int j = 0; j < quantityOccupied; j++) {
for (int j = 0; j < i.getReservationNum(); j++) {
//构建库存品
DisStockListDetailEntity disStockListDetailEntity = new DisStockListDetailEntity();
disStockListDetailEntity.setNum(1);
@ -1976,8 +1993,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
disStockListDetailEntity.setStockType(InventoryTypeConstant.saoma.getValue());
disStockListDetailEntity.setWarehouseId(myCurrentWarehouse.getId());
disStockListDetailEntity.setWarehouseName(myCurrentWarehouse.getName());
disStockListDetailEntity.setReservationStockListId(distributionReservationStocklistEntity.getId());
disStockListDetailEntity.setReservationId(reservationId);
detailEntities.add(disStockListDetailEntity);
disStockListDetailEntity.setStockPackageStatus(InventoryPackageStatusConstant.zhengchang.getValue());
}
//完成库存品详情的添加
disStockListDetailService.saveBatch(detailEntities);

3
blade-service/logpm-factory/src/main/java/com/logpm/factory/interceptor/ZbFactoryAccountsInterceptor.java

@ -55,6 +55,9 @@ public class ZbFactoryAccountsInterceptor implements HandlerInterceptor {
log.info(" 新签名 old {}",newSign);
String s = body.replaceAll(" +", "");
String newSign = QmSignUntil.signTopRequest(params, zbFactoryProperties.getSecretkey(), signMethod, s);
if(!newSign.equals(sign)){
returnJson(response,JSONObject.toJSONString(R.fail(203,"签名认证失败")));
return false;

Loading…
Cancel
Save