diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java index 7c62d6387..b7807be09 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockListEntity.java @@ -102,12 +102,12 @@ public class DistributionStockListEntity extends TenantEntity { * 货物ID */ @ApiModelProperty(value = "货物id") - private String material; + private Long materialId; /** * 仓库 */ @ApiModelProperty(value = "仓库") - private String warehouse; + private Long warehouse; /** * 拆分包件 */ @@ -124,21 +124,21 @@ public class DistributionStockListEntity extends TenantEntity { */ @ApiModelProperty(value = "品分类") private String category; -// /** -// * 商场 -// */ -// @ApiModelProperty(value = "商场") -// private String market; + /** + * 商场ID + */ + @ApiModelProperty(value = "商场ID") + private Long marketId; /** * 货物单位 */ @ApiModelProperty(value = "货物单位") private String cargoUnit; - /** - * 门店 - */ - @ApiModelProperty(value = "门店") - private String shop; +// /** +// * 门店 +// */ +// @ApiModelProperty(value = "门店") +// private String shop; /** * 库位信息 */ @@ -195,12 +195,12 @@ public class DistributionStockListEntity extends TenantEntity { * 门店ID */ @ApiModelProperty(value = "门店ID") - private String storeId; + private Long storeId; /** * 所属商场 */ @ApiModelProperty(value = "所属商场") - private String shoppingMall; + private Long shoppingMall; /** * 商场编码 */ @@ -230,5 +230,4 @@ public class DistributionStockListEntity extends TenantEntity { - } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java index 320e763e1..b3b05756e 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockListClient.java @@ -16,11 +16,11 @@ */ package com.logpm.distribution.feign; +import com.logpm.distribution.vo.DistributionStockListVO; import org.springblade.core.mp.support.BladePage; import com.logpm.distribution.entity.DistributionStockListEntity; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.*; /** * 库存品管理 Feign接口类 @@ -29,12 +29,15 @@ import org.springframework.web.bind.annotation.RequestParam; * @since 2023-06-15 */ @FeignClient( - value = "blade-distributionStockList" + value = "logpm-distribution-cyz" ) public interface IDistributionStockListClient { String API_PREFIX = "/client"; String TOP = API_PREFIX + "/t1op"; + String QUERYDATA = API_PREFIX + "/getQueryData"; + String ADDSTOCKLIST = API_PREFIX + "/addStockList"; + String PUTSTOCKLIST = API_PREFIX + "/putStockList"; /** * 获取库存品管理列表 @@ -46,4 +49,28 @@ public interface IDistributionStockListClient { @GetMapping(TOP) BladePage top(@RequestParam("current") Integer current, @RequestParam("size") Integer size); + /** + * 查询某个客户信息及物品信息 + * + * @return BladePage + */ + @GetMapping(QUERYDATA) + DistributionStockListVO getQueryData(@RequestParam("storeId") Long storeId,@RequestParam("clientId") Long clientId,@RequestParam("materialId") Long materialId); + + /** + * 添加某个客户信息及物品信息 + * + * @return BladePage + */ + @PostMapping(ADDSTOCKLIST) + Boolean getAddStockList(@RequestBody DistributionStockListEntity distributionStockListEntity); + +// /** +// * 修改某个客户信息及物品信息 +// * +// * @return BladePage +// */ +// @PutMapping(PUTSTOCKLIST) +// Boolean putStockList(@RequestBody DistributionStockListEntity distributionStockListEntity); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java index 2a40936ec..768ba1b9d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockListClient.java @@ -17,6 +17,7 @@ package com.logpm.distribution.feign; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.vo.DistributionStockListVO; import lombok.AllArgsConstructor; import org.springblade.core.mp.support.BladePage; import org.springblade.core.mp.support.Condition; @@ -24,6 +25,8 @@ import org.springblade.core.mp.support.Query; import com.logpm.distribution.entity.DistributionStockListEntity; import com.logpm.distribution.service.IDistributionStockListService; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import springfox.documentation.annotations.ApiIgnore; @@ -50,4 +53,31 @@ public class DistributionStockListClient implements IDistributionStockListClient return BladePage.of(page); } + /** + * + * @param + * @return + */ + @Override + @GetMapping(QUERYDATA) + public DistributionStockListVO getQueryData( Long storeId, Long clientId,Long materialId) { + DistributionStockListVO distributionStockListVO = distributionStockListService.getQueryData(storeId, clientId, materialId); + return distributionStockListVO ; + } + + /** + * 添加 + * @param distributionStockListEntity + * @return + */ + @Override + @PostMapping(ADDSTOCKLIST) + public Boolean getAddStockList(DistributionStockListEntity distributionStockListEntity) { + + Boolean dis = distributionStockListService.getAddStockList(distributionStockListEntity); + return dis ; + } + + + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index 82598e4e8..e6f02c23c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -69,4 +69,8 @@ public interface IDistributionStockListService extends BaseService data, Boolean isCovered); Boolean parcels(DistributionStockListEntity distributionStockList); + + DistributionStockListVO getQueryData(Long storeId, Long clientId,Long materialId); + + Boolean getAddStockList(DistributionStockListEntity distributionStockListEntity); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index b85b6c0e0..03a151b6f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -225,10 +225,10 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl list = new ArrayList<>(); + if(Func.isNotEmpty(storeId)){ + //门店 + list = baseMapper.selectList(Wrappers.query().lambda() + .eq(DistributionStockListEntity::getStoreId,storeId)//门店 + .eq(DistributionStockListEntity::getMaterialId,materialId)//货物 + ); + }else if(Func.isNotEmpty(clientId)){ + //客户商场 + list = baseMapper.selectList(Wrappers.query().lambda() + .eq(DistributionStockListEntity::getMarketId,clientId)//商场 + .eq(DistributionStockListEntity::getMaterialId,materialId)//货物 + ); + } + if(list.size() > 0){ + AtomicReference num = new AtomicReference<>(0); + list.forEach(i ->{ + num.updateAndGet(v -> v + i.getQuantityStock()); + }); + DistributionStockListEntity distributionStockList= list.get(0); + distributionStockList.setQuantityStock(num.get()); + BeanUtils.copyProperties(distributionStockList,distributionStockListVO); + return distributionStockListVO; + } + return null; + } + + /** + * 添加 + * @param distributionStockList + * @return + */ + @Override + public Boolean getAddStockList(DistributionStockListEntity distributionStockList) { + return this.save(distributionStockList); + } + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java index 991db107c..236f9325a 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java @@ -19,6 +19,9 @@ package com.logpm.warehouse.service.impl; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.eventbus.AllowConcurrentEvents; +import com.logpm.distribution.entity.DistributionStockListEntity; +import com.logpm.distribution.feign.IDistributionStockListClient; +import com.logpm.distribution.vo.DistributionStockListVO; import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO; import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity; import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity; @@ -52,6 +55,7 @@ import java.util.List; @Service public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl implements IWarehouseWarehousingEntryService { private final IWarehouseWarehousingDetailService warehouseWarehousingDetailService; + private final IDistributionStockListClient distributionStockListClient; @@ -138,21 +142,80 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl