From 248e3dea19c68eeb534278e996530d9436849d51 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 14 Oct 2024 18:23:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=85=A5=E5=BA=93=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E3=80=81=E4=BF=AE=E6=94=B9=E5=9C=A8=E5=BA=93=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicdataGoodsAllocationEntity.java | 5 ++ .../IBasicdataGoodsAllocationClient.java | 33 +++++++++++ .../entity/WarehouseConfigEntity.java | 12 ++++ .../IWarehouseGoodsAllocationClient.java | 1 + .../BasicdataGoodsAllocationController.java | 10 ++++ .../feign/BasicdataGoodsAllocationClient.java | 28 +++++++++ .../mapper/BasicdataGoodsAllocationMapper.xml | 1 + .../IBasicdataGoodsAllocationService.java | 21 +++++++ .../BasicdataGoodsAllocationServiceImpl.java | 58 +++++++++++++++++++ .../mapper/DistributionStockArticleMapper.xml | 8 +-- .../mapper/DistrilbutionBillLadingMapper.xml | 8 ++- .../controller/WarehouseConfigController.java | 4 +- .../feign/WarehouseGoodsAllocationClient.java | 1 + .../service/IWarehouseConfigService.java | 7 +++ .../impl/WarehouseConfigServiceImpl.java | 39 +++++++++++++ .../WarehouseWarehousingEntryServiceImpl.java | 52 ++++++++++++----- 16 files changed, 267 insertions(+), 21 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java index e6d5144d8..efadf3408 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataGoodsAllocationEntity.java +++ b/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; diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java index a92bc2e66..543d80a81 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataGoodsAllocationClient.java +++ b/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 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); } diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java index e4363194b..869af202d 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseConfigEntity.java +++ b/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 */ diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java index 84da5f512..4ff39bf5f 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java +++ b/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); + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java index 2025b8020..d78f74a9d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsAllocationController.java +++ b/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); + } + /** * 货位 新增或修改 */ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java index 34c2b95c8..0b8ef3071 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataGoodsAllocationClient.java +++ b/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.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.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); + } + } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml index a710bdf78..ffcfd7a48 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml +++ b/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 '存储库位' diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java index a9fc0b76c..840393dcc 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataGoodsAllocationService.java @@ -131,4 +131,25 @@ public interface IBasicdataGoodsAllocationService extends BaseService selectBasicdataGoodsAllocationPage(IPage page, BasicdataGoodsAllocationVO BasicdataGoodsAllocation) { @@ -372,4 +377,57 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImplupdate().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(); + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index 505044a10..901a42d84 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -987,11 +987,11 @@ #{wIitem} - and ldpl.waybill_number = - #{param.waybillNumber} + and ldpl.waybill_number LIKE CONCAT('%',#{param.waybillNumber},'%') + - and ldsa.order_code = #{param.orderCode} - and ldsa.mall_name = #{param.mallName} + and ldsa.order_code LIKE CONCAT('%',#{param.orderCode},'%') + and ldsa.mall_name LIKE CONCAT('%',#{param.mallName},'%') and ldsa.type_service = #{param.typeService} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 9027811e6..c5e7bab6f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -470,10 +470,12 @@ lad.is_deleted = 0 and lad.warehouse_id = #{param.warehouseId} - and lad.pick_up_time between - #{param.pickUpTimeStart} and #{param.pickUpTimeEnd} + + 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') - and lad.conditions in (10,20) + + and lad.conditions in (10,20) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseConfigController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseConfigController.java index 3d8788aa7..8973dc800 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseConfigController.java +++ b/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); } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java index d82ad97ee..aeff2b86b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java +++ b/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); } + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseConfigService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseConfigService.java index 602a6475d..62f93363b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseConfigService.java +++ b/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 { + /** + * 修改仓库配置 + * @param warehouseConfigEntity + * @return + */ + R updateWarehouseConfigEntity(WarehouseConfigEntity warehouseConfigEntity); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java index 3f2ec193b..9b469df22 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseConfigServiceImpl.java +++ b/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> distriType = dictBizClient.getList("distribution_type"); if (ObjectUtils.isNotNull(distriType)) { List 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>>>>>>>>>>+++++"+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 detailEntityList = new ArrayList<>(); v.forEach(i -> { @@ -580,6 +596,16 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl