Browse Source

Merge remote-tracking branch 'origin/dev' into dev

visual
pref_mail@163.com 3 months ago
parent
commit
d20f214b81
  1. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java
  2. 33
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java
  3. 12
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java
  4. 1
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java
  5. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java
  6. 28
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java
  7. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
  8. 21
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java
  9. 58
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java
  10. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  11. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml
  12. 119
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java
  13. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageBasicServiceImpl.java
  14. 2
      blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageTrunklineServiceImpl.java
  15. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseConfigController.java
  16. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java
  17. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseConfigService.java
  18. 39
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java
  19. 52
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

5
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java

@ -129,6 +129,11 @@ public class BasicdataGoodsAllocationEntity extends TenantEntity {
*/
@ApiModelProperty(value = "旧库位码")
private String oldQrCode;
/**
* 旧库位码
*/
@ApiModelProperty(value = "旧库位码")
private Integer isDefault;

33
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java

@ -75,4 +75,37 @@ public interface IBasicdataGoodsAllocationClient {
@PostMapping(API_PREFIX+"/updateListAllocationStatus")
void updateListAllocationStatus(@RequestParam List<Long> updateAllocationIds, @RequestParam String allocationStatus);
/**
* 查询默认库位
* @param warehouseId
* @return
*/
@GetMapping(API_PREFIX+"/findDefaultGoodsAllocation")
BasicdataGoodsAllocationEntity findDefaultGoodsAllocation(@RequestParam Long warehouseId);
/**
* 通过QRCode查询库位
* @param warehouseId
* @param defaultAllocation
* @return
*/
@GetMapping(API_PREFIX+"/findEntityByQrCode")
BasicdataGoodsAllocationEntity findEntityByQrCode(@RequestParam Long warehouseId,@RequestParam String defaultAllocation);
/**
* 开启默认库位
* @param id
* @return
*/
@GetMapping(API_PREFIX+"/openDefaultAllocation")
boolean openDefaultAllocation(@RequestParam Long id);
/**
* 关闭默认库位
* @param warehouseId
* @return
*/
@GetMapping(API_PREFIX+"/closeDefaultAllocation")
boolean closeDefaultAllocation(@RequestParam Long id);
}

12
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java

@ -33,6 +33,18 @@ public class WarehouseConfigEntity extends TenantEntity {
@ApiModelProperty(value = "是否自动释放")
private Integer isAutoRelease;
/**
* 库存品是否自动上架
*/
@ApiModelProperty(value = "库存品是否自动上架")
private Integer isAutoWarehouse;
/**
* 默认库位
*/
@ApiModelProperty(value = "默认库位")
private String defaultAllocation;
/**
* 预留1
*/

1
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java

@ -64,4 +64,5 @@ public interface IWarehouseGoodsAllocationClient {
@GetMapping(TOP+ "/findByAllocationQrCode")
WarehouseGoodsAllocationEntity findByAllocationQrCode(@RequestParam String positions);
}

10
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java

@ -126,6 +126,16 @@ public class BasicdataGoodsAllocationController extends BladeController {
return R.status(basicdataGoodsAllocationService.updateGoodsAllocation(basicdataGoodsAllocationDto));
}
/**
* 货位 修改
*/
@PostMapping("/updateDefault")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入BasicdataGoodsAllocation")
public R updateDefault(@Valid @RequestBody BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) {
return basicdataGoodsAllocationService.updateDefaultGoodsAllocation(basicdataGoodsAllocationDto);
}
/**
* 货位 新增或修改
*/

28
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java

@ -19,9 +19,11 @@ package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.service.IBasicdataGoodsAllocationService;
import lombok.AllArgsConstructor;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -122,4 +124,30 @@ public class BasicdataGoodsAllocationClient implements IBasicdataGoodsAllocation
BasicdataGoodsAllocationService.update(updateWrapper);
}
@Override
public BasicdataGoodsAllocationEntity findDefaultGoodsAllocation(Long warehouseId) {
return BasicdataGoodsAllocationService.getOne(Wrappers.<BasicdataGoodsAllocationEntity>query().lambda()
.eq(BasicdataGoodsAllocationEntity::getWarehouseId,warehouseId)
.eq(BasicdataGoodsAllocationEntity::getIsDefault, Integer.parseInt(IsOrNoConstant.yes.getValue()))
);
}
@Override
public BasicdataGoodsAllocationEntity findEntityByQrCode(Long warehouseId, String defaultAllocation) {
return BasicdataGoodsAllocationService.getOne(Wrappers.<BasicdataGoodsAllocationEntity>query().lambda()
.eq(BasicdataGoodsAllocationEntity::getWarehouseId,warehouseId)
.eq(BasicdataGoodsAllocationEntity::getQrCode, defaultAllocation)
);
}
@Override
public boolean openDefaultAllocation(Long id) {
return BasicdataGoodsAllocationService.openDefaultAllocation(id);
}
@Override
public boolean closeDefaultAllocation(Long id) {
return BasicdataGoodsAllocationService.closeDefaultAllocation(id);
}
}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml

@ -99,6 +99,7 @@
goods_area.headline AS goodsAreaName,
warehouse.name AS warehouseName,
goods_area.area_type AS area_type,
goods_allocation.is_default,
CASE goods_area.area_type
WHEN 1 THEN '备货库位'
WHEN 2 THEN '存储库位'

21
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java

@ -131,4 +131,25 @@ public interface IBasicdataGoodsAllocationService extends BaseService<BasicdataG
* @return
*/
BasicdataGoodsAllocationEntity findStockUpAllocationById(Long warehouseId, Long stockUpAllocationId);
/**
* 修改默认库位
* @param basicdataGoodsAllocationDto
* @return
*/
R updateDefaultGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto);
/**
* 开启默认库位
* @param id
* @return
*/
boolean openDefaultAllocation(Long id);
/**
* 关闭默认库位
* @param id
* @return
*/
boolean closeDefaultAllocation(Long id);
}

58
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAllocationServiceImpl.java

@ -38,9 +38,12 @@ import com.logpm.basicdata.vo.BasicdataGoodsAllocationVO;
import com.logpm.basicdata.vo.BasicdataNodeVO;
import com.logpm.basicdata.vo.FreightSpaceVO;
import com.logpm.basicdata.vo.WarehouseAllocationInfoVO;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.feign.IWarehouseConfigClient;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
@ -88,6 +91,8 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
private final BladeRedis bladeRedis;
private final IWarehouseConfigClient warehouseConfigClient;
@Override
public IPage<BasicdataGoodsAllocationVO> selectBasicdataGoodsAllocationPage(IPage<BasicdataGoodsAllocationVO> page, BasicdataGoodsAllocationVO BasicdataGoodsAllocation) {
@ -372,4 +377,57 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
return baseMapper.findStockUpAllocationById(warehouseId,stockUpAllocationId);
}
@Override
public R updateDefaultGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) {
if (Objects.isNull(basicdataGoodsAllocationDto.getIsDefault())){
return R.fail("缺少必要参数IsDefault");
}
if (Objects.isNull(basicdataGoodsAllocationDto.getId())){
return R.fail("缺少必要参数Id");
}
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)){
return R.fail(403,"未授权!!!");
}
Integer isDefault = basicdataGoodsAllocationDto.getIsDefault();
Long goodsAllocationDtoId = basicdataGoodsAllocationDto.getId();
if (Integer.parseInt(IsOrNoConstant.no.getValue()) == isDefault){
//此时检验是否开启了默认入库
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId());
int a = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
if ( Integer.parseInt(IsOrNoConstant.yes.getValue()) == a ){
//开启自动入库必须开启一个默认库位
return R.fail("自动入库开启必须开启默认库位");
}
}
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity();
basicdataGoodsAllocationEntity.setId(goodsAllocationDtoId);
basicdataGoodsAllocationEntity.setIsDefault(isDefault);
//开启默认库位先进行所有的默认库位关闭
this.update(Wrappers.<BasicdataGoodsAllocationEntity>update().lambda()
.eq(BasicdataGoodsAllocationEntity::getWarehouseId,myCurrentWarehouse.getId())
.ne(BasicdataGoodsAllocationEntity::getId,goodsAllocationDtoId)
.set(BasicdataGoodsAllocationEntity::getIsDefault,Integer.parseInt(IsOrNoConstant.no.getValue()))
);
return R.status(this.updateById(basicdataGoodsAllocationEntity));
}
@Override
public boolean openDefaultAllocation(Long id) {
BasicdataGoodsAllocationDTO basicdataGoodsAllocationDTO = new BasicdataGoodsAllocationDTO();
basicdataGoodsAllocationDTO.setId(id);
basicdataGoodsAllocationDTO.setIsDefault(Integer.parseInt(IsOrNoConstant.yes.getValue()));
R r = this.updateDefaultGoodsAllocation(basicdataGoodsAllocationDTO);
return r.isSuccess();
}
@Override
public boolean closeDefaultAllocation(Long id) {
BasicdataGoodsAllocationDTO basicdataGoodsAllocationDTO = new BasicdataGoodsAllocationDTO();
basicdataGoodsAllocationDTO.setId(id);
basicdataGoodsAllocationDTO.setIsDefault(Integer.parseInt(IsOrNoConstant.no.getValue()));
R r = this.updateDefaultGoodsAllocation(basicdataGoodsAllocationDTO);
return r.isSuccess();
}
}

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

@ -987,11 +987,11 @@
#{wIitem}
</foreach>
</if>
<if test="param.waybillNumber != null and param.waybillNumber != ''">and ldpl.waybill_number =
#{param.waybillNumber}
<if test="param.waybillNumber != null and param.waybillNumber != ''">and ldpl.waybill_number LIKE CONCAT('%',#{param.waybillNumber},'%')
</if>
<if test="param.orderCode != null and param.orderCode != ''">and ldsa.order_code = #{param.orderCode}</if>
<if test="param.mallName != null and param.mallName != ''">and ldsa.mall_name = #{param.mallName}</if>
<if test="param.orderCode != null and param.orderCode != ''">and ldsa.order_code LIKE CONCAT('%',#{param.orderCode},'%') </if>
<if test="param.mallName != null and param.mallName != ''">and ldsa.mall_name LIKE CONCAT('%',#{param.mallName},'%') </if>
<if test="param.typeService != null and param.typeService != ''">and ldsa.type_service =
#{param.typeService}
</if>

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

@ -470,10 +470,12 @@
<where>
lad.is_deleted = 0
and lad.warehouse_id = #{param.warehouseId}
<if test="param.pickUpTimeStart != null and param.pickUpTimeStart!='' ">and lad.pick_up_time between
#{param.pickUpTimeStart} and #{param.pickUpTimeEnd}
<if test="param.pickUpTimeStart != null and param.pickUpTimeStart!='' ">
AND DATE_FORMAT(lad.pick_up_time,'%y%m%d') between
DATE_FORMAT(#{param.pickUpTimeStart},'%y%m%d') and DATE_FORMAT(#{param.pickUpTimeEnd},'%y%m%d')
</if>
<if test="param.conditions != null and param.conditions == 10" >and lad.conditions in (10,20)</if>
<if test="param.conditions != null and param.conditions == 10" >
and lad.conditions in (10,20)</if>
</where>

119
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverListener.java

@ -3,11 +3,11 @@ package com.logpm.distribution.receiver.report;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataFactoryCategoryEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataFactoryCategoryClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
@ -20,7 +20,6 @@ import com.logpm.distribution.service.IDistributionParcelListService;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IQualityDeliverService;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import com.logpm.trunkline.feign.ITrunklineAdvanceDetailClient;
import com.logpm.warehouse.entity.WarehouseWayBillDetail;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
@ -32,6 +31,7 @@ import org.jetbrains.annotations.Nullable;
import org.springblade.common.constant.report.ReportConstants;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.core.redis.cache.BladeRedis;
import org.springframework.amqp.core.ExchangeTypes;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
@ -81,6 +81,9 @@ public class QualityDeliverListener {
@Resource
private IWarehouseWaybillDetailClient waybillDetailClient;
@Resource
private BladeRedis redisCache;
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = ReportConstants.REPORT_QUALITY_DELIVER_QUEUE, durable = "true"),
exchange = @Exchange(name = ReportConstants.REPORT_QUALITY_DELIVER_EXCHANGE, type = ExchangeTypes.TOPIC),
@ -194,11 +197,13 @@ public class QualityDeliverListener {
private void saveOrUpdate(LambdaQueryWrapper<QualityDeliverEntity> wrapper, QualityDeliverEntity qualityDeliverEntity) {
QualityDeliverEntity entity = null;
if (ObjectUtil.isNotEmpty(wrapper)) {
wrapper.select(QualityDeliverEntity::getId);
entity = qualityDeliverService.getOne(wrapper);
}
if (ObjectUtil.isNotEmpty(entity)) {
// 修改
qualityDeliverService.update(qualityDeliverEntity, wrapper);
qualityDeliverEntity.setId(entity.getId());
qualityDeliverService.updateById(qualityDeliverEntity);
} else {
// 新增
// 初始化基础数据
@ -214,7 +219,7 @@ public class QualityDeliverListener {
if (ObjectUtil.equals(PackageTypeEnums.CMP.getCode(), conditions)) {
// 订制品
// 构建订制品基础信息
DistributionParcelListEntity parcelListEntity = parcelListService.selectByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode(), qualityDeliverEntity.getWarehouseId());
DistributionParcelListEntity parcelListEntity = getDistributionParcelListEntity(qualityDeliverEntity.getOrderPackageCode(), qualityDeliverEntity.getWarehouseId());
buildCmpBasicInfo(qualityDeliverEntity, parcelListEntity);
}
if (ObjectUtil.equals(PackageTypeEnums.INV.getCode(), conditions)) {
@ -236,6 +241,11 @@ public class QualityDeliverListener {
}
}
private DistributionParcelListEntity getDistributionParcelListEntity(String orderPackageCode, Long warehouseId) {
DistributionParcelListEntity parcelListEntity = parcelListService.selectByOrderPackageCode(orderPackageCode, warehouseId);
return parcelListEntity;
}
private void buildInvBasicInfo(QualityDeliverEntity qualityDeliverEntity) {
String materielName = qualityDeliverEntity.getMaterielName();
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
@ -249,7 +259,7 @@ public class QualityDeliverListener {
String brandName = stockList.getBrandName();
String sourceType = stockList.getSourceType();
if (StrUtil.equals(sourceType, "1")) {
DistributionParcelListEntity parcelListEntity = parcelListService.selectByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode(), qualityDeliverEntity.getWarehouseId());
DistributionParcelListEntity parcelListEntity = getDistributionParcelListEntity(qualityDeliverEntity.getOrderPackageCode(), qualityDeliverEntity.getWarehouseId());
buildCmpBasicInfo(qualityDeliverEntity, parcelListEntity);
} else {
qualityDeliverEntity.setBrandName(brandName);
@ -262,24 +272,24 @@ public class QualityDeliverListener {
qualityDeliverEntity.setEndWarehouseInTime(stockList.getWarehousingTime());
}
// 品类
if (StrUtil.isNotEmpty(materielName) && StrUtil.isNotEmpty(brandName)) {
BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity();
factoryCategoryEntity.setMaterielName(materielName);
factoryCategoryEntity.setBrand(brandName);
factoryCategoryEntity.setType(2);
BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity);
factoryCategoryEntity.setType(1);
BasicdataFactoryCategoryEntity categoryEntity1 = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity);
if (ObjectUtil.isNotEmpty(categoryEntity)) {
qualityDeliverEntity.setCostCategoryId(categoryEntity.getCategoryId());
qualityDeliverEntity.setCostCategory(categoryEntity.getCategory());
}
if (ObjectUtil.isNotEmpty(categoryEntity1)) {
qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory());
qualityDeliverEntity.setRevenueCategoryId(categoryEntity1.getCategoryId());
}
// if (StrUtil.isNotEmpty(materielName) && StrUtil.isNotEmpty(brandName)) {
// BasicdataFactoryCategoryEntity factoryCategoryEntity = new BasicdataFactoryCategoryEntity();
// factoryCategoryEntity.setMaterielName(materielName);
// factoryCategoryEntity.setBrand(brandName);
// factoryCategoryEntity.setType(2);
// BasicdataFactoryCategoryEntity categoryEntity = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity);
// factoryCategoryEntity.setType(1);
// BasicdataFactoryCategoryEntity categoryEntity1 = factoryCategoryClient.findEntityByBrandAndMaterielName(factoryCategoryEntity);
// if (ObjectUtil.isNotEmpty(categoryEntity)) {
// qualityDeliverEntity.setCostCategoryId(categoryEntity.getCategoryId());
// qualityDeliverEntity.setCostCategory(categoryEntity.getCategory());
// }
// if (ObjectUtil.isNotEmpty(categoryEntity1)) {
// qualityDeliverEntity.setRevenueCategory(categoryEntity.getCategory());
// qualityDeliverEntity.setRevenueCategoryId(categoryEntity1.getCategoryId());
// }
// TODO 从入库单上查询入库时间
}
// }
}
}
@ -322,19 +332,19 @@ public class QualityDeliverListener {
buildWaybillInfo(qualityDeliverEntity, waybillNumber);
}
// 暂存单查询结算品类
TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode());
if (ObjectUtil.isNotEmpty(advanceDetailEntity)) {
qualityDeliverEntity.setCostCategoryId(advanceDetailEntity.getCostCategoryId());
qualityDeliverEntity.setCostCategory(advanceDetailEntity.getCostCategoryName());
qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId());
qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName());
}
// TrunklineAdvanceDetailEntity advanceDetailEntity = advanceDetailClient.findEntityByOrderPackageCode(qualityDeliverEntity.getOrderPackageCode());
// if (ObjectUtil.isNotEmpty(advanceDetailEntity)) {
// qualityDeliverEntity.setCostCategoryId(advanceDetailEntity.getCostCategoryId());
// qualityDeliverEntity.setCostCategory(advanceDetailEntity.getCostCategoryName());
// qualityDeliverEntity.setRevenueCategoryId(advanceDetailEntity.getIncomeCategoryId());
// qualityDeliverEntity.setRevenueCategory(advanceDetailEntity.getIncomeCategoryName());
// }
// 构建订单相关信息
buildOrderInfo(qualityDeliverEntity, qualityDeliverEntity.getWarehouseId(), qualityDeliverEntity.getOrderCode());
}
private void buildOrderInfo(QualityDeliverEntity qualityDeliverEntity, Long warehouseId, String orderCode) {
DistributionStockArticleEntity stockArticleEntity = stockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
DistributionStockArticleEntity stockArticleEntity = getDistributionStockArticleEntity(warehouseId, orderCode);
if (ObjectUtil.isNotEmpty(stockArticleEntity)) {
// 客户信息
qualityDeliverEntity.setCustomName(stockArticleEntity.getCustomerName());
@ -356,9 +366,23 @@ public class QualityDeliverListener {
}
}
private DistributionStockArticleEntity getDistributionStockArticleEntity(Long warehouseId, String orderCode) {
String key = "report:qualityDeliver:stockArticle:" + warehouseId + "_" + orderCode;
String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) {
return JSONUtil.toBean(obj, DistributionStockArticleEntity.class);
}
DistributionStockArticleEntity stockArticleEntity = stockArticleService.findStockArticleByOrderCodeAndWarehouseId(orderCode, warehouseId);
if (ObjectUtil.isNotEmpty(stockArticleEntity)) {
redisCache.setEx(key, JSONUtil.toJsonStr(stockArticleEntity), 60 * 60L + RandomUtil.randomInt(600));
return stockArticleEntity;
}
return null;
}
private void buildWaybillInfo(QualityDeliverEntity qualityDeliverEntity, String waybillNumber) {
if (StrUtil.isNotEmpty(waybillNumber)) {
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNumber);
WarehouseWaybillEntity byWaybillNo = getWarehouseWaybillEntity(waybillNumber);
if (ObjectUtil.isNotEmpty(byWaybillNo)) {
// 运单发货信息
qualityDeliverEntity.setShipperUnitId(byWaybillNo.getShipperId());
@ -380,14 +404,41 @@ public class QualityDeliverListener {
}
}
private WarehouseWaybillEntity getWarehouseWaybillEntity(String waybillNumber) {
String key = "report:qualityDeliver:waybill:" + waybillNumber;
String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) {
return JSONUtil.toBean(obj, WarehouseWaybillEntity.class);
}
WarehouseWaybillEntity byWaybillNo = warehouseWaybillClient.findByWaybillNo(waybillNumber);
if (ObjectUtil.isNotEmpty(byWaybillNo)) {
redisCache.setEx(key, JSONUtil.toJsonStr(byWaybillNo), 60 * 60L + RandomUtil.randomInt(600));
return byWaybillNo;
}
return null;
}
private void warehouseInfo(QualityDeliverEntity qualityDeliverEntity) {
List<BasicdataWarehouseEntity> warehouseEntities = warehouseClient.findWarehousesByIds(Arrays.asList(qualityDeliverEntity.getWarehouseId()));
if (CollUtil.isNotEmpty(warehouseEntities)) {
BasicdataWarehouseEntity warehouseEntity = warehouseEntities.get(0);
BasicdataWarehouseEntity warehouseEntity = getBasicdataWarehouseEntities(qualityDeliverEntity.getWarehouseId());
if (ObjectUtil.isNotEmpty(warehouseEntity)) {
// 事业线
qualityDeliverEntity.setBusinessUnit(warehouseEntity.getBusinessLine());
qualityDeliverEntity.setWarehousePosition(StrUtil.concat(true, Convert.toStr(warehouseEntity.getLongitude()), ",", Convert.toStr(warehouseEntity.getLatitude())));
}
}
public BasicdataWarehouseEntity getBasicdataWarehouseEntities(Long warehouseId) {
String key = "report:qualityDeliver:warehouse:" + warehouseId;
String obj = redisCache.get(key);
if (StrUtil.isNotEmpty(obj)) {
return JSONUtil.toBean(obj, BasicdataWarehouseEntity.class);
}
List<BasicdataWarehouseEntity> warehouseEntities = warehouseClient.findWarehousesByIds(Arrays.asList(warehouseId));
if (CollUtil.isNotEmpty(warehouseEntities)) {
redisCache.setEx(key, JSONUtil.toJsonStr(warehouseEntities.get(0)), 60 * 60L + RandomUtil.randomInt(600));
return warehouseEntities.get(0);
}
return null;
}
}

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageBasicServiceImpl.java

@ -3,8 +3,8 @@ package com.logpm.report.service.impl;
import com.logpm.report.entity.ReportPackageBasicEntity;
import com.logpm.report.mapper.ReportPackageBasicMapper;
import com.logpm.report.service.IReportPackageBasicService;
import groovy.util.logging.Slf4j;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

2
blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/ReportPackageTrunklineServiceImpl.java

@ -3,8 +3,8 @@ package com.logpm.report.service.impl;
import com.logpm.report.entity.ReportPackageTrunklineEntity;
import com.logpm.report.mapper.ReportPackageTrunklineMapper;
import com.logpm.report.service.IReportPackageTrunklineService;
import groovy.util.logging.Slf4j;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;

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

@ -97,7 +97,9 @@ public class WarehouseConfigController extends BladeController {
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入warehouseWaybill")
public R update(@Valid @RequestBody WarehouseConfigEntity warehouseConfigEntity) {
return R.status(warehouseConfigService.updateById(warehouseConfigEntity));
return warehouseConfigService.updateWarehouseConfigEntity(warehouseConfigEntity);
}
}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java

@ -78,4 +78,5 @@ public class WarehouseGoodsAllocationClient implements IWarehouseGoodsAllocation
.eq(WarehouseGoodsAllocationEntity::getQrCode,positions)
).get(0);
}
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseConfigService.java

@ -3,8 +3,15 @@ package com.logpm.warehouse.service;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseLog;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
public interface IWarehouseConfigService extends BaseService<WarehouseConfigEntity> {
/**
* 修改仓库配置
* @param warehouseConfigEntity
* @return
*/
R updateWarehouseConfigEntity(WarehouseConfigEntity warehouseConfigEntity);
}

39
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java

@ -1,16 +1,24 @@
package com.logpm.warehouse.service.impl;
import com.logpm.basicdata.entity.BasicdataGoodsAllocationEntity;
import com.logpm.basicdata.feign.IBasicdataGoodsAllocationClient;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.entity.WarehouseLog;
import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient;
import com.logpm.warehouse.mapper.WarehouseConfigMapper;
import com.logpm.warehouse.mapper.WarehouseLogMapper;
import com.logpm.warehouse.service.IWarehouseConfigService;
import com.logpm.warehouse.service.IWarehouseLogService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springframework.stereotype.Service;
import java.util.Objects;
@Slf4j
@AllArgsConstructor
@Service
@ -18,5 +26,36 @@ public class WarehouseConfigServiceImpl extends BaseServiceImpl<WarehouseConfigM
private final WarehouseConfigMapper warehouseConfigMapper;
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
@Override
public R updateWarehouseConfigEntity(WarehouseConfigEntity warehouseConfigEntity) {
boolean flag = false;
if (warehouseConfigEntity.getIsAutoWarehouse() == Integer.parseInt(IsOrNoConstant.yes.getValue())) {
//要求先开启默认库位
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.findEntityByQrCode(warehouseConfigEntity.getWarehouseId(), warehouseConfigEntity.getDefaultAllocation());
if (Objects.isNull(goodsAllocationEntity)) {
return R.fail("查询库位信息失败,请输入正确的库位名称!!!");
}
//进行默认库位的开启
flag = basicdataGoodsAllocationClient.openDefaultAllocation(goodsAllocationEntity.getId());
if (flag) {
return R.status(this.updateById(warehouseConfigEntity));
}
} else {
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.findEntityByQrCode(warehouseConfigEntity.getWarehouseId(), warehouseConfigEntity.getDefaultAllocation());
if (Objects.isNull(goodsAllocationEntity)) {
return R.fail("查询库位信息失败,请输入正确的库位名称!!!");
}
this.updateById(warehouseConfigEntity);
//关闭配置进行默认库位的清理
flag = basicdataGoodsAllocationClient.closeDefaultAllocation(goodsAllocationEntity.getId());
warehouseConfigEntity.setDefaultAllocation("");
return R.status(flag);
}
return R.fail("未知错误!!!");
}
}

52
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -28,14 +28,8 @@ import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.entity.BasicdataClientEntity;
import com.logpm.basicdata.entity.BasicdataStoreBrandEntity;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataClientClient;
import com.logpm.basicdata.feign.IBasicdataStoreBrandClient;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.feign.*;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.entity.DistributionStockListInfoEntity;
import com.logpm.distribution.feign.IDistributionStockListClient;
@ -45,11 +39,13 @@ import com.logpm.distribution.vo.print.PrintPreviewVO;
import com.logpm.warehouse.dto.NoDataStockListDTO;
import com.logpm.warehouse.dto.UpShelfStockDTO;
import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO;
import com.logpm.warehouse.entity.WarehouseConfigEntity;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity;
import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity;
import com.logpm.warehouse.excel.WarehouseWarehousingEntryExcel;
import com.logpm.warehouse.excel.WarehousingEntryDetailExcel;
import com.logpm.warehouse.feign.IWarehouseConfigClient;
import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient;
import com.logpm.warehouse.mapper.WarehouseWarehousingEntryMapper;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
@ -61,6 +57,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.DistributionTypeConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.TemplateUtil;
@ -109,6 +106,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
private final IWarehouseTrayTypeService warehouseTrayTypeService;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
private final IUserClient userClient;
private final IWarehouseConfigClient warehouseConfigClient;
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
@Override
@ -522,11 +521,6 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
R<List<DictBiz>> distriType = dictBizClient.getList("distribution_type");
if (ObjectUtils.isNotNull(distriType)) {
List<DictBiz> data1 = distriType.getData();
// data1.forEach( a ->{
// if(o.getServiceType().equals(a.getDictValue())){
// entryEntity.setServiceType(a.getDictKey()); //仓库名称
// }
// });
DictBiz dictBiz = data1.stream().filter(da -> {
return o.getServiceType().equals(da.getDictValue());
}).findAny().get();
@ -544,6 +538,28 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
// System.out.println(">>>>>>>>>>>+++++"+k+v);
WarehouseWarehousingEntryEntity entryEntity = JSON.parseObject(k, WarehouseWarehousingEntryEntity.class);
// WarehouseWarehousingEntryEntity entryEntity = JSONObject.parseObject(JSONObject.toJSONString(k), WarehouseWarehousingEntryEntity.class);
Integer isAutoWarehouse;
if (!Objects.isNull(entryEntity.getWarehouseId())){
//查询是否开启自动上架配置
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(entryEntity.getWarehouseId());
if (!Objects.isNull(warehouseConfig)){
isAutoWarehouse = warehouseConfig.getIsAutoWarehouse() != null ? warehouseConfig.getIsAutoWarehouse() : 0;
} else {
isAutoWarehouse = 0;
}
} else {
isAutoWarehouse = 0;
}
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse){
//查询默认备货库位
BasicdataGoodsAllocationEntity defaultGoodsAllocation = basicdataGoodsAllocationClient.findDefaultGoodsAllocation(entryEntity.getWarehouseId());
if (!Objects.isNull(defaultGoodsAllocation)){
if (Objects.isNull(entryEntity.getPositions())){
entryEntity.setPositions(defaultGoodsAllocation.getQrCode());
}
}
}
this.save(entryEntity);
List<WarehouseWarehousingDetailEntity> detailEntityList = new ArrayList<>();
v.forEach(i -> {
@ -580,6 +596,16 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
detail.setTrayName(basicdataTrayEntity.getPalletName());
}
}
}else {
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isAutoWarehouse){
//库位
WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity = warehouseGoodsAllocationClient.findByAllocationQrCode(entryEntity.getPositions());
if (Func.isNotEmpty(warehouseGoodsAllocationEntity)) {
detail.setLoadingType(1);
detail.setAllocationId(warehouseGoodsAllocationEntity.getId());
detail.setAllocationName(warehouseGoodsAllocationEntity.getQrCode());
}
}
}
//品牌
BasicdataStoreBrandEntity brandList = basicdataStoreBrandClient.getBrandList(entryEntity.getClientId(), i.getBrandName());

Loading…
Cancel
Save