|
@@ -12,10 +12,12 @@ import com.gubersail.dealer.admin.api.fc.customer.vo.FcCustomerDescVo;
|
|
|
import com.gubersail.dealer.admin.api.fc.price.entity.ProductLaunch;
|
|
|
import com.gubersail.dealer.admin.api.inventory.entity.PjStockDesc;
|
|
|
import com.gubersail.dealer.admin.api.inventory.vo.PjStockDescVo;
|
|
|
+import com.gubersail.dealer.admin.api.inventory.vo.StockDescExcelVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
+import org.springblade.core.excel.util.ExcelUtil;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.secure.BladeUser;
|
|
@@ -27,6 +29,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -65,6 +68,7 @@ public class StockDescController extends BladeController {
|
|
|
.eq(ObjectUtil.isNotEmpty(stockDesc.getBrandId()), PjStockDesc::getBrandId, stockDesc.getBrandId())
|
|
|
.eq(ObjectUtil.isNotEmpty(stockDesc.getBrandName()), PjStockDesc::getBrandName, stockDesc.getBrandName())
|
|
|
.eq(ObjectUtil.isNotEmpty(stockDesc.getGoodsTypeId()), PjStockDesc::getGoodsTypeId, stockDesc.getGoodsTypeId())
|
|
|
+ .like(StringUtils.hasText(stockDesc.getGoodsTypeName()), PjStockDesc::getGoodsTypeName, stockDesc.getGoodsTypeName())
|
|
|
.like(StringUtils.hasText(stockDesc.getDot()), PjStockDesc::getDot, stockDesc.getDot());
|
|
|
lambdaQueryWrapper.like(StringUtils.hasText(stockDesc.getCname()), PjStockDesc::getCname, stockDesc.getCname());
|
|
|
lambdaQueryWrapper.orderByDesc(PjStockDesc::getBalanceQuantity);
|
|
@@ -108,4 +112,29 @@ public class StockDescController extends BladeController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @GetMapping("/stockExport")
|
|
|
+ public void stockExport(PjStockDescVo stockDesc, HttpServletResponse response) {
|
|
|
+ BladeUser bladeUser = AuthUtil.getUser();
|
|
|
+ LambdaQueryWrapper<PjStockDesc> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(PjStockDesc::getTenantId, bladeUser.getTenantId())
|
|
|
+ .eq(PjStockDesc::getIsDeleted, 0)
|
|
|
+ .eq(PjStockDesc::getSalesCompanyId, bladeUser.getDeptId())
|
|
|
+ .like(StringUtils.hasText(stockDesc.getCode()), PjStockDesc::getCode, stockDesc.getCode())
|
|
|
+ .like(StringUtils.hasText(stockDesc.getTypeNo()), PjStockDesc::getTypeNo, stockDesc.getTypeNo())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(stockDesc.getStorageId()), PjStockDesc::getStorageId, stockDesc.getStorageId())
|
|
|
+ .like(StringUtils.hasText(stockDesc.getStorageName()), PjStockDesc::getStorageName, stockDesc.getStorageName())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(stockDesc.getBrandId()), PjStockDesc::getBrandId, stockDesc.getBrandId())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(stockDesc.getBrandName()), PjStockDesc::getBrandName, stockDesc.getBrandName())
|
|
|
+ .eq(ObjectUtil.isNotEmpty(stockDesc.getGoodsTypeId()), PjStockDesc::getGoodsTypeId, stockDesc.getGoodsTypeId())
|
|
|
+ .like(StringUtils.hasText(stockDesc.getGoodsTypeName()), PjStockDesc::getGoodsTypeName, stockDesc.getGoodsTypeName())
|
|
|
+ .like(StringUtils.hasText(stockDesc.getDot()), PjStockDesc::getDot, stockDesc.getDot());
|
|
|
+ lambdaQueryWrapper.like(StringUtils.hasText(stockDesc.getCname()), PjStockDesc::getCname, stockDesc.getCname());
|
|
|
+ lambdaQueryWrapper.orderByDesc(PjStockDesc::getBalanceQuantity);
|
|
|
+ List<PjStockDesc> stockDescList = stockDescService.list(lambdaQueryWrapper);
|
|
|
+ ExcelUtil.export(response, "商品信息", "商品信息", BeanUtil.copy(stockDescList, StockDescExcelVo.class), StockDescExcelVo.class);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|