|
|
@@ -17,6 +17,7 @@
|
|
|
package org.springblade.mocha.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
@@ -24,6 +25,8 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
+import org.springblade.client.entity.GoodsType;
|
|
|
+import org.springblade.client.feign.IGoodsDescClient;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
@@ -51,6 +54,7 @@ import java.time.Period;
|
|
|
public class PriceBankController extends BladeController {
|
|
|
|
|
|
private final IPriceBankService priceBankService;
|
|
|
+ private final IGoodsDescClient goodsDescClient;
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
|
@@ -69,8 +73,25 @@ public class PriceBankController extends BladeController {
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperationSupport(order = 2)
|
|
|
@ApiOperation(value = "分页", notes = "传入priceBank")
|
|
|
- public R<IPage<PriceBank>> list(PriceBank priceBank, Query query) {
|
|
|
- IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), Condition.getQueryWrapper(priceBank));
|
|
|
+ public R<IPage<PriceBank>> list(PriceBankVO priceBank, Query query) {
|
|
|
+ LambdaQueryWrapper<PriceBank> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ 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.getCname()),PriceBank::getCname,priceBank.getCname());
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()),PriceBank::getCorpId,priceBank.getCorpId());
|
|
|
+ lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()),PriceBank::getSpecs,priceBank.getSpecs());
|
|
|
+ lambdaQueryWrapper.le(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getStartTime,priceBank.getStatusTime());
|
|
|
+ lambdaQueryWrapper.ge(Func.isNotEmpty(priceBank.getStatusTime()),PriceBank::getEndTime,priceBank.getStatusTime());
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()),PriceBank::getBillType,priceBank.getBillType());
|
|
|
+ IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
+ if (CollectionUtils.isNotEmpty(pages.getRecords())){
|
|
|
+ pages.getRecords().stream().forEach(item ->{
|
|
|
+ GoodsType goodsType = goodsDescClient.goodTypeId(item.getItemId());
|
|
|
+ item.setGoodsTypeName(goodsType.getCname());
|
|
|
+ });
|
|
|
+ }
|
|
|
return R.data(pages);
|
|
|
}
|
|
|
|
|
|
@@ -88,6 +109,7 @@ public class PriceBankController extends BladeController {
|
|
|
lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getCname()),PriceBank::getCname,priceBank.getCname());
|
|
|
lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getCorpId()),PriceBank::getCorpId,priceBank.getCorpId());
|
|
|
lambdaQueryWrapper.like(Func.isNotEmpty(priceBank.getSpecs()),PriceBank::getSpecs,priceBank.getSpecs());
|
|
|
+ lambdaQueryWrapper.eq(Func.isNotEmpty(priceBank.getBillType()),PriceBank::getBillType,priceBank.getBillType());
|
|
|
IPage<PriceBank> pages = priceBankService.page(Condition.getPage(query), lambdaQueryWrapper);
|
|
|
return R.data(pages);
|
|
|
}
|