|
@@ -3,15 +3,22 @@ package org.springblade.factory.api.controller;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.mp.support.Condition;
|
|
import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.mp.support.Query;
|
|
|
|
|
+import org.springblade.core.secure.BladeUser;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.factory.entity.PcBladeSalesForecastSummary;
|
|
import org.springblade.factory.entity.PcBladeSalesForecastSummary;
|
|
|
|
|
+import org.springblade.factory.entity.PjpfBrandDesc;
|
|
|
|
|
+import org.springblade.factory.entity.PjpfStockDesc;
|
|
|
import org.springblade.factory.service.PcBladeSalesForecastSummaryService;
|
|
import org.springblade.factory.service.PcBladeSalesForecastSummaryService;
|
|
|
|
|
+import org.springblade.factory.service.PjpfBrandDescService;
|
|
|
|
|
+import org.springblade.factory.service.PjpfStockDescService;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
@@ -269,6 +276,72 @@ public class SalesForecastSummaryController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+ /* ========== 品牌表 ========== */
|
|
|
|
|
|
|
|
|
|
+ private final PjpfBrandDescService brandService;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 品牌列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/brand-desc")
|
|
|
|
|
+ @ApiOperation(value = "品牌列表", notes = "传入cname,status,type等查询条件")
|
|
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
|
|
+ public R<IPage<PjpfBrandDesc>> brandDesc(
|
|
|
|
|
+ @ApiIgnore @RequestParam Map<String, Object> brandParams,
|
|
|
|
|
+ Query query,
|
|
|
|
|
+ BladeUser bladeUser) {
|
|
|
|
|
+ // 构建查询条件
|
|
|
|
|
+ QueryWrapper<PjpfBrandDesc> queryWrapper = Condition.getQueryWrapper(brandParams, PjpfBrandDesc.class);
|
|
|
|
|
+ // 执行分页查询
|
|
|
|
|
+ IPage<PjpfBrandDesc> pages = brandService.page(Condition.getPage(query), queryWrapper);
|
|
|
|
|
+ // 转换VO并返回
|
|
|
|
|
+ return R.data(pages);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 单条查询
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/brand-desc/{id}")
|
|
|
|
|
+ @ApiOperation(value = "单条查询", notes = "传入品牌ID")
|
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "品牌ID", required = true, paramType = "path")
|
|
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
|
|
+ public R<PjpfBrandDesc> getBrandDesc(@PathVariable("id") Long id) {
|
|
|
|
|
+ PjpfBrandDesc brand = brandService.getById(id);
|
|
|
|
|
+ return R.data(brand);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /* ========== 库存表 ========== */
|
|
|
|
|
+ private final PjpfStockDescService stockService;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 库存列表
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("brand-stock")
|
|
|
|
|
+ @ApiOperation(value = "库存列表", notes = "传入cname,goodsId,brandId等查询条件")
|
|
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
|
|
+ public R<IPage<PjpfStockDesc>> brandStock(
|
|
|
|
|
+ @ApiIgnore @RequestParam Map<String, Object> stockParams,
|
|
|
|
|
+ Query query,
|
|
|
|
|
+ BladeUser bladeUser) {
|
|
|
|
|
+ // 构建查询条件
|
|
|
|
|
+ QueryWrapper<PjpfStockDesc> queryWrapper = Condition.getQueryWrapper(stockParams, PjpfStockDesc.class);
|
|
|
|
|
+ // 执行分页查询
|
|
|
|
|
+ IPage<PjpfStockDesc> pages = stockService.page(Condition.getPage(query), queryWrapper);
|
|
|
|
|
+ // 转换VO并返回
|
|
|
|
|
+ return R.data(pages);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 单条查询
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/brand-stock/{id}")
|
|
|
|
|
+ @ApiOperation(value = "单条查询", notes = "传入库存ID")
|
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "库存ID", required = true, paramType = "path")
|
|
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
|
|
+ public R<PjpfStockDesc> getBrandStock(@PathVariable("id") Long id) {
|
|
|
|
|
+ PjpfStockDesc stock = stockService.getById(id);
|
|
|
|
|
+ return R.data(stock);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|