From a6342521bb1f06da915635d0441dd8d8e2022f32 Mon Sep 17 00:00:00 2001 From: guoyuji <guoyujie@ng.com> Date: 星期五, 29 三月 2024 09:58:54 +0800 Subject: [PATCH] 添加基础数据前后端程序 --- north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialStoreController.java | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 54 insertions(+), 0 deletions(-) diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialStoreController.java b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialStoreController.java new file mode 100644 index 0000000..2dd9e67 --- /dev/null +++ b/north-glass-erp/src/main/java/com/example/erp/controller/mm/MaterialStoreController.java @@ -0,0 +1,54 @@ +package com.example.erp.controller.mm; + + +import com.example.erp.common.Constants; +import com.example.erp.common.Result; +import com.example.erp.entity.mm.MaterialStore; +import com.example.erp.exception.ServiceException; +import com.example.erp.service.mm.MaterialStoreService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +@RestController +@RequestMapping("/MaterialStore") +@Api(value="鐗╂枡controller",tags={"鐗╂枡鎿嶄綔鎺ュ彛"}) +public class MaterialStoreController { + @Autowired + MaterialStoreService materialStoreService; + + @ApiOperation("鐗╂枡鏂板鎺ュ彛") + @PostMapping("/saveMaterialStore") + public Result saveMaterialStore( @RequestBody Map<String,Object> object){ + if(materialStoreService.saveMaterialStore(object)){ + return Result.seccess(); + }else { + throw new ServiceException(Constants.Code_500,"淇濆瓨澶辫触"); + + } + } + + @ApiOperation("鐗╂枡鏌ヨ鎺ュ彛") + @PostMapping("/getSelectMaterialStore/{pageNum}/{pageSize}") + public Result getSelectMaterialStore(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @RequestBody MaterialStore materialStore){ + return Result.seccess(materialStoreService.getSelectMaterialStore(pageNum,pageSize,materialStore)); + } + + @ApiOperation("鐗╂枡鍒犻櫎鎺ュ彛") + @PostMapping("/deleteMaterialStore") + public Result deleteMaterialStore( @RequestBody Map<String,Object> object){ + if(materialStoreService.deleteMaterialStore(object)){ + + return Result.seccess(); + + }else { + throw new ServiceException(Constants.Code_500,"鍒犻櫎澶辫触"); + + } + } + + +} -- Gitblit v1.8.0