|
|
@@ -299,6 +299,87 @@ public class PriceBankController extends BladeController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 福达查询产品
|
|
|
+ */
|
|
|
+ @GetMapping("/pageListAllV1")
|
|
|
+ public R<List<PriceBank>> pageListAllV1(PriceBankVO priceBank) {
|
|
|
+ LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ if (priceBank.getGoodTypeId() != null) {
|
|
|
+ List<Long> goodTypeMessage = corpsDescClient.getGoodTypeMessage(priceBank.getGoodTypeId());
|
|
|
+ if (CollectionUtils.isNotEmpty(goodTypeMessage)) {
|
|
|
+ lambdaQueryWrapper.in(PriceBank::getGoodTypeId, goodTypeMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getIsDeleted, 0);
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getStatus, 0);
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTenantId, SecureUtil.getTenantId());
|
|
|
+ lambdaQueryWrapper.eq(PriceBank::getTradeType, "CK");
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getItemId()), PriceBank::getItemId, priceBank.getItemId());
|
|
|
+ if (ObjectUtils.isNotNull(priceBank.getCname())) {
|
|
|
+ String[] arr = priceBank.getCname().split(" ");
|
|
|
+ for (String item : arr) {
|
|
|
+ lambdaQueryWrapper.like(PriceBank::getCname, item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCode()), PriceBank::getCode, priceBank.getCode());
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()), PriceBank::getCorpId, priceBank.getCorpId());
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()), PriceBank::getSpecs, priceBank.getSpecs());
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getGoodsTypeName()), PriceBank::getGoodsTypeName, priceBank.getGoodsTypeName());
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()), PriceBank::getEndTime, priceBank.getStatusTime());
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getEname()), PriceBank::getEname, priceBank.getEname());
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getDateValidityStart()), PriceBank::getEndTime, priceBank.getDateValidityStart());
|
|
|
+ lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getDateValidityEnd()), PriceBank::getEndTime, priceBank.getDateValidityEnd());
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()), PriceBank::getBillType, priceBank.getBillType());
|
|
|
+ lambdaQueryWrapper.orderByDesc(PriceBank::getId);
|
|
|
+ List<PriceBank> pages = priceBankService.list(lambdaQueryWrapper);
|
|
|
+ if (CollectionUtils.isNotEmpty(pages)) {
|
|
|
+ String corpIds = "";
|
|
|
+ String goodsIds = "";
|
|
|
+ List<Long> goodsSpecification = new ArrayList<>();
|
|
|
+ for (PriceBank item : pages) {
|
|
|
+ corpIds = corpIds + item.getCorpId() + ",";
|
|
|
+ goodsIds = goodsIds + item.getItemId() + ",";
|
|
|
+ goodsSpecification.add(item.getItemId());
|
|
|
+ }
|
|
|
+ List<CorpsDesc> corpsDescList = new ArrayList<>();
|
|
|
+ if (ObjectUtils.isNotNull(corpIds)) {
|
|
|
+ corpsDescList = corpsDescClient.selectByCorpIds(corpIds.substring(0, corpIds.length() - 1));
|
|
|
+ }
|
|
|
+ List<GoodsDesc> goodsList = new ArrayList<>();
|
|
|
+ if (ObjectUtils.isNotNull(goodsIds)) {
|
|
|
+ goodsList = goodsDescClient.selectItemsIdGoods(goodsIds.substring(0, corpIds.length() - 1));
|
|
|
+ }
|
|
|
+ List<GoodsSpecification> goodsSpecificationList = new ArrayList<>();
|
|
|
+ if (!goodsSpecification.isEmpty()){
|
|
|
+ goodsSpecificationList = goodsDescClient.goodsSpecificationLists(goodsSpecification);
|
|
|
+ }
|
|
|
+ for (PriceBank item : pages) {
|
|
|
+ if (ObjectUtils.isNotNull(item.getItemId()) && !goodsList.isEmpty()) {
|
|
|
+ //商品
|
|
|
+ GoodsDesc goodsDesc = goodsList.stream().filter(goods -> goods.getId().equals(item.getItemId())).findFirst().orElse(null);
|
|
|
+ if (goodsDesc != null) {
|
|
|
+ item.setCnameDescription(goodsDesc.getCnameDescription());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(item.getItemId()) && !goodsSpecificationList.isEmpty()) {
|
|
|
+ List<GoodsSpecification> goodsSpecifications = goodsSpecificationList.stream().filter(e -> e.getPid().equals(item.getItemId())).collect(Collectors.toList());
|
|
|
+ List<GoodsSpecificationDto> goodsSpecificationDtoList = BeanUtil.copy(goodsSpecifications, GoodsSpecificationDto.class);
|
|
|
+ item.setGoodsSpecificationList(goodsSpecificationDtoList);
|
|
|
+ }
|
|
|
+ if (item.getCorpId() != null && !corpsDescList.isEmpty()) {
|
|
|
+ //客户
|
|
|
+ CorpsDesc corpsDesc = corpsDescList.stream().filter(corps -> corps.getId().equals(item.getCorpId())).findFirst().orElse(null);
|
|
|
+ if (corpsDesc != null) {
|
|
|
+ item.setCorpCode(corpsDesc.getCode());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 新增 出口价格库
|
|
|
*/
|
|
|
@PostMapping("/save")
|