|
|
@@ -6,10 +6,10 @@ import com.sckw.core.model.page.PageHelperUtil;
|
|
|
import com.sckw.core.model.page.PageResult;
|
|
|
import com.sckw.core.model.vo.TableStatisticRes;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
-import com.sckw.product.model.vo.req.AddGoodsParam;
|
|
|
-import com.sckw.product.model.vo.req.GoodsListParam;
|
|
|
-import com.sckw.product.model.vo.req.SelectGoodsListParam;
|
|
|
+import com.sckw.product.model.vo.req.*;
|
|
|
+import com.sckw.product.model.vo.res.BuildingMaterialsMarketList;
|
|
|
import com.sckw.product.model.vo.res.GoodsDetail;
|
|
|
+import com.sckw.product.model.vo.res.GoodsDropList;
|
|
|
import com.sckw.product.model.vo.res.GoodsList;
|
|
|
import com.sckw.product.service.KwpGoodsService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@@ -41,7 +41,7 @@ public class KwpGoodsController {
|
|
|
@PostMapping(value = "/addDraft", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult addDraft(@RequestBody AddGoodsParam addGoodsParam) {
|
|
|
kwpGoodsService.addDraft(addGoodsParam);
|
|
|
- return HttpResult.ok();
|
|
|
+ return HttpResult.ok("添加草稿商品成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -54,7 +54,7 @@ public class KwpGoodsController {
|
|
|
@PostMapping(value = "/addShelves", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult addShelves(@RequestBody @Validated AddGoodsParam addGoodsParam) {
|
|
|
kwpGoodsService.addShelves(addGoodsParam);
|
|
|
- return HttpResult.ok();
|
|
|
+ return HttpResult.ok("添加上架商品成功");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -70,6 +70,19 @@ public class KwpGoodsController {
|
|
|
return HttpResult.ok(goodsDetail);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 修改
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 9:02
|
|
|
+ * @Param updateGoodsParam:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public HttpResult update(@RequestBody @Validated UpdateGoodsParam updateGoodsParam) {
|
|
|
+ kwpGoodsService.update(updateGoodsParam);
|
|
|
+ return HttpResult.ok("修改成功");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @desc: 分页查询商品列表
|
|
|
@@ -86,10 +99,98 @@ public class KwpGoodsController {
|
|
|
return HttpResult.ok(result);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 统计查询
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 8:33
|
|
|
+ * @Param params:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
@PostMapping(value = "/statistic", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult statistic(@RequestBody GoodsListParam params) {
|
|
|
TableStatisticRes tableStatisticRes = kwpGoodsService.statistic(params);
|
|
|
return HttpResult.ok(tableStatisticRes);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @desc: 导出
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 8:33
|
|
|
+ * @Param params:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/export", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public void export(@RequestBody GoodsListParam params) {
|
|
|
+ kwpGoodsService.export(params);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 批量上架
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 8:56
|
|
|
+ * @Param ids:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @GetMapping("/batchPutOnShelves")
|
|
|
+ public HttpResult batchPutOnShelves(@RequestParam List<Long> ids) {
|
|
|
+ kwpGoodsService.batchPutOnShelves(ids);
|
|
|
+ return HttpResult.ok("批量上架成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 批量下架
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 8:56
|
|
|
+ * @Param ids:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @GetMapping("/batchTakeOffShelves")
|
|
|
+ public HttpResult batchTakeOffShelves(@RequestParam List<Long> ids) {
|
|
|
+ kwpGoodsService.batchTakeOffShelves(ids);
|
|
|
+ return HttpResult.ok("批量下架成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 批量删除
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 8:56
|
|
|
+ * @Param ids:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @GetMapping("/batchDelete")
|
|
|
+ public HttpResult batchDelete(@RequestParam List<Long> ids) {
|
|
|
+ kwpGoodsService.batchDelete(ids);
|
|
|
+ return HttpResult.ok("批量删除成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 建材市场分页查询
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 9:38
|
|
|
+ * @Param params:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/buildingMaterialsMarketList", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public HttpResult buildingMaterialsMarketList(@RequestBody BuildingMaterialsMarketListParam params) {
|
|
|
+ PageHelper.startPage(params.getPage(), params.getPageSize());
|
|
|
+ List<BuildingMaterialsMarketList> list = kwpGoodsService.buildingMaterialsMarketList(params);
|
|
|
+ PageResult result = PageHelperUtil.getPageResult(new PageInfo<>(list));
|
|
|
+ return HttpResult.ok(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc: 商品下拉列表
|
|
|
+ * @author: yzc
|
|
|
+ * @date: 2023-07-06 8:37
|
|
|
+ * @Param params:
|
|
|
+ * @return: com.sckw.core.web.response.HttpResult
|
|
|
+ */
|
|
|
+ @PostMapping(value = "/dropList", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public HttpResult dropList(@RequestBody GoodsDropListReq params) {
|
|
|
+ List<GoodsDropList> list = kwpGoodsService.dropList(params);
|
|
|
+ return HttpResult.ok(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|