package com.gkhy.hazmat.admin.controller.app;
|
|
|
import com.gkhy.hazmat.common.annotation.RepeatSubmit;
|
import com.gkhy.hazmat.common.api.CommonResult;
|
import com.gkhy.hazmat.system.service.HzProductService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 危化品表 前端控制器
|
* </p>
|
*
|
* @author kzy
|
* @since 2024-08-05 14:41:40
|
*/
|
@Api(tags = "APP成品前端控制器")
|
@RestController
|
@RequestMapping("/app/product")
|
public class AppProductController {
|
@Autowired
|
private HzProductService productService;
|
|
@PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
|
@ApiOperation(value = "根据条码查询成品信息")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "query", name = "code", dataType = "string", required = true, value = "条码code")
|
})
|
@GetMapping("/getProductByCode")
|
public CommonResult getProductByCode(@RequestParam(required = true)String code){
|
return CommonResult.success(productService.selectProductByCode(code));
|
}
|
|
@PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
|
@RepeatSubmit
|
@ApiOperation(value = "销售")
|
@PostMapping(value = { "/productSold/{productId}" })
|
public CommonResult productSold(@PathVariable(value = "productId", required = true) Long productId){
|
productService.productSold(productId);
|
return CommonResult.success();
|
}
|
|
@PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
|
@RepeatSubmit
|
@ApiOperation(value = "二维码作废")
|
@PostMapping(value = { "/productDiscard/{productId}" })
|
public CommonResult productDiscard(@PathVariable(value = "productId", required = true) Long productId){
|
productService.productDiscard(productId);
|
return CommonResult.success();
|
}
|
}
|