危化品全生命周期管理后端
“djh”
2025-04-21 437f8e2b89a18363a1073fdbb3ab99bcd840a757
hazmat-admin/src/main/java/com/gkhy/hazmat/admin/controller/web/HzHazmatFlowController.java
@@ -35,7 +35,9 @@
    @ApiOperation(value = "流向列表(分页)")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "pageNum", dataType = "int", required = false, value = "当前页,默认1"),
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10")
            @ApiImplicitParam(paramType = "query", name = "pageSize", dataType = "int", required = false, value = "每页数目,默认10"),
            @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "long", required = false, value = "公司id"),
    })
    @GetMapping("/list")
    public CommonResult list(HzHazmatFlow hazmatFlow){
@@ -51,9 +53,14 @@
    @ApiOperation(value = "根据危化品id查询危化品所有流向")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "hazmatId", dataType = "long", required = false, value = "公司id"),
            @ApiImplicitParam(paramType = "query", name = "companyId", dataType = "long", required = false, value = "公司id"),
    })
    @GetMapping(value = { "/getAllHazmatFlowByHazmatId" })
    public CommonResult getAllHazmatFlowByHazmatId(Long hazmatId){
        return CommonResult.success(hazmatFlowService.getAllHazmatFlowByHazmatId(hazmatId));
    public CommonResult getAllHazmatFlowByHazmatId(Long hazmatId,Long companyId){
        return CommonResult.success(hazmatFlowService.getAllHazmatFlowByHazmatId(hazmatId,companyId));
    }
    @RepeatSubmit
@@ -64,14 +71,14 @@
        return CommonResult.success(hazmatFlowService.deleteHazmatFlowById(hazmatFlowId));
    }
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common')")
    @PreAuthorize("hasAnyAuthority('hazmat:manage:company','hazmat:manage:common','hazmat:manage:system')")
    @ApiOperation(value = "根据条码code查询危化品所有流向")
    @GetMapping(value = { "/getHazmatFlowByCode" })
    public CommonResult getAllHazmatFlowByCode(@RequestParam(required = true) String  code){
    public CommonResult getAllHazmatFlowByCode(@RequestParam(required = true) String  code,@RequestParam("companyId") Long companyId){
        if(code.startsWith(CodePrexEnum.MATERIAL.getCode())){
            return CommonResult.success(hazmatFlowService.selectAllHazmatFlowByCode(code));
            return CommonResult.success(hazmatFlowService.selectAllHazmatFlowByCode(code,companyId));
        }else if(code.startsWith(CodePrexEnum.GOOD.getCode())){
            return CommonResult.success(productFlowService.selectAllProductFlowByCode(code));
            return CommonResult.success(productFlowService.selectAllProductFlowByCode(code,companyId));
        }else{
            return CommonResult.failed("条码格式不正确");
        }