|
|
@@ -1,5 +1,6 @@
|
|
|
package com.sckw.product.controller;
|
|
|
|
|
|
+import com.sckw.core.annotation.Log;
|
|
|
import com.sckw.core.exception.BusinessException;
|
|
|
import com.sckw.core.utils.CollectionUtils;
|
|
|
import com.sckw.core.utils.StringUtils;
|
|
|
@@ -36,6 +37,7 @@ public class KwpGoodsController {
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
@PostMapping(value = "/addDraft", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ @Log(description = "添加草稿商品")
|
|
|
public HttpResult addDraft(@RequestBody @Validated AddGoodsDraftParam param) {
|
|
|
kwpGoodsService.addDraft(param);
|
|
|
return HttpResult.ok("添加草稿商品成功");
|
|
|
@@ -48,6 +50,7 @@ public class KwpGoodsController {
|
|
|
* @Param addGoodsParam:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "添加上架草稿")
|
|
|
@PostMapping(value = "/addShelves", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult addShelves(@RequestBody @Validated AddGoodsParam addGoodsParam) {
|
|
|
kwpGoodsService.addShelves(addGoodsParam);
|
|
|
@@ -62,6 +65,7 @@ public class KwpGoodsController {
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
@GetMapping("/detail")
|
|
|
+ @Log(description = "获取商品详情")
|
|
|
public HttpResult detail(@RequestParam Long id) {
|
|
|
return HttpResult.ok(kwpGoodsService.detail(id, false));
|
|
|
}
|
|
|
@@ -73,6 +77,7 @@ public class KwpGoodsController {
|
|
|
* @Param updateGoodsParam:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "修改商品")
|
|
|
@PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult update(@RequestBody @Validated UpdateGoodsParam updateGoodsParam) {
|
|
|
kwpGoodsService.update(updateGoodsParam);
|
|
|
@@ -87,6 +92,7 @@ public class KwpGoodsController {
|
|
|
* @Param params:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "分页查询商品列表")
|
|
|
@PostMapping(value = "/select", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult select(@RequestBody SelectGoodsListParam params) {
|
|
|
return HttpResult.ok(kwpGoodsService.select(params, true));
|
|
|
@@ -99,6 +105,7 @@ public class KwpGoodsController {
|
|
|
* @Param params:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "商品列表统计查询")
|
|
|
@PostMapping(value = "/statistic", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult statistic(@RequestBody GoodsListParam params) {
|
|
|
return HttpResult.ok(kwpGoodsService.statistic(params));
|
|
|
@@ -128,6 +135,7 @@ public class KwpGoodsController {
|
|
|
* @Param id:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "商品上架")
|
|
|
@GetMapping("/batchPutOnShelves")
|
|
|
public HttpResult batchPutOnShelves(@RequestParam Long id) {
|
|
|
kwpGoodsService.batchPutOnShelves(id);
|
|
|
@@ -141,6 +149,7 @@ public class KwpGoodsController {
|
|
|
* @Param ids:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "商品批量下架")
|
|
|
@GetMapping("/batchTakeOffShelves")
|
|
|
public HttpResult batchTakeOffShelves(@RequestParam String ids) {
|
|
|
List<Long> goodIds = StringUtils.splitStrToList(ids, ",", Long.class);
|
|
|
@@ -155,6 +164,7 @@ public class KwpGoodsController {
|
|
|
* @Param ids:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "商品批量删除")
|
|
|
@GetMapping("/batchDelete")
|
|
|
public HttpResult batchDelete(@RequestParam String ids) {
|
|
|
List<Long> goodIds = StringUtils.splitStrToList(ids, ",", Long.class);
|
|
|
@@ -169,6 +179,7 @@ public class KwpGoodsController {
|
|
|
* @Param params:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "建材市场分页查询")
|
|
|
@PostMapping(value = "/buildingMaterialsMarketList", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult buildingMaterialsMarketList(@RequestBody BuildingMaterialsMarketListParam params) {
|
|
|
return HttpResult.ok(kwpGoodsService.buildingMaterialsMarketList(params));
|
|
|
@@ -181,6 +192,7 @@ public class KwpGoodsController {
|
|
|
* @Param params:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "商品下拉列表")
|
|
|
@PostMapping(value = "/dropList", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult dropList(@RequestBody @Validated GoodsDropListReq params) {
|
|
|
return HttpResult.ok(kwpGoodsService.dropList(params));
|
|
|
@@ -193,6 +205,7 @@ public class KwpGoodsController {
|
|
|
* @Param param:
|
|
|
* @return: com.sckw.core.web.response.HttpResult
|
|
|
*/
|
|
|
+ @Log(description = "获取商品预计最大可购数量")
|
|
|
@PostMapping(value = "/maxPurchaseNum", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public HttpResult maxPurchaseNum(@RequestBody @Validated MaxPurchaseNumParam param) {
|
|
|
return HttpResult.ok(kwpGoodsService.maxPurchaseNum(param));
|