chenlu
5 小时以前 33dbc6a161554f3a897f9e9273feb4f2c1b47381
north-glass-erp/src/main/java/com/example/erp/controller/sd/ProductController.java
@@ -6,8 +6,6 @@
import com.example.erp.service.sd.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Delete;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@@ -27,40 +25,54 @@
    @ApiOperation("产品查询接口")
    @SaCheckPermission("selectProduct.search")
    @PostMapping  ("/{pageNum}/{pageSize}/{glassType}")
    public Result defaultDateProduct(@PathVariable Integer pageNum, @PathVariable Integer pageSize, @PathVariable List<String> glassType, @RequestBody Product product){
        return Result.seccess(productService.defaultDateProduct(pageNum,pageSize,glassType,product));
    public Result defaultDateProduct(@PathVariable Integer pageNum,
                                     @PathVariable Integer pageSize,
                                     @PathVariable List<String> glassType,
                                     @RequestBody Map<String,Object> config){
        return Result.success(productService.defaultDateProduct(pageNum,pageSize,glassType,config));
    }
    @ApiOperation("其他系统获取产品查询接口")
    @PostMapping("/otherSysGetProduct")
    public Result otherSysGetProduct(){
        return Result.success(productService.otherSysGetProduct());
    }
    @ApiOperation("产品保存接口")
    @SaCheckPermission("createProduct.add")
    @PostMapping("/saveProduct")
    public Result saveProduct(@RequestBody Map<String,Object> product){
        return Result.seccess(productService.saveProduct(product));
    @PostMapping("/saveProduct/{operator}")
    public Result saveProduct(@PathVariable String operator,@RequestBody Map<String,Object> product){
        return Result.success(productService.saveProduct(product,operator));
    }
    @ApiOperation("其他系统产品保存接口")
    @PostMapping("/otherSysSaveProduct")
    public Result otherSysSaveProduct(@RequestBody Map<String,Object> product){
        return Result.success(productService.saveProduct(product,null));
    }
    @ApiOperation("产品查重接口")
    @SaCheckPermission("createProduct.add")
    @PostMapping("/selectProduct/{productName}")
    public Result selectProduct(@PathVariable String productName,@RequestBody Map<String,Object> product){
        return Result.seccess(productService.selectProduct(productName,product));
        return Result.success(productService.selectProduct(productName,product));
    }
    @ApiOperation("产品删除接口")
    @SaCheckPermission("selectProduct.delete")
    @PostMapping("/deleteProductById/{id}")
    public Result deleteProductById(@PathVariable Integer id){
        return Result.seccess(productService.deleteProductById(id));
    @PostMapping("/deleteProductById/{id}/{operator}")
    public Result deleteProductById(@PathVariable Integer id,@PathVariable String operator){
        return Result.success(productService.deleteProductById(id,operator));
    }
    @ApiOperation("产品审核状态修改接口")
    @SaCheckPermission("createProduct.review")
    @PostMapping("/updateProductStateById/{id}/{state}")
    public Result updateProductStateById(@PathVariable Integer id,@PathVariable Integer state){
        return Result.seccess(productService.updateProductStateById(id,state));
    @PostMapping("/updateProductStateById/{id}/{state}/{operator}")
    public Result updateProductStateById(@PathVariable Integer id,@PathVariable Integer state,@PathVariable String operator){
        return Result.success(productService.updateProductStateById(id,state,operator));
    }
    @ApiOperation("根据产品id查询产品接口")
    @SaCheckPermission("selectProduct.edit")
    @PostMapping("/selectProductById/{id}")
    public Result selectProductById(@PathVariable Integer id){
        return Result.seccess(productService.selectProductById(id));
        return Result.success(productService.selectProductById(id));
    }
}