lidongdong
2022-10-13 d63453b5a1c52e44b957471035e2232d1b3d2da9
flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java
@@ -15,6 +15,7 @@
import com.dg.core.util.TableDataInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
@@ -94,6 +95,22 @@
    @Authorization
    public ResultData insertConfig(@RequestBody TransactionEvent entity)
    {
        if(StringUtils.isEmpty(entity.getDepartmentId()))
        {
            return ResultData.error("部门id不能为空");
        }
        if(StringUtils.isEmpty(entity.getMatterName()))
        {
            return ResultData.error("事件名称不能为空");
        }
        String id=iTransactionEventService.selectDataIfExist(entity.getDepartmentId(),entity.getMatterName());
        if(!StringUtils.isEmpty(id))
        {
            return ResultData.error("事件名称已存在");
        }
        return toAjax(iTransactionEventService.insertConfig(entity));
    }
@@ -107,6 +124,16 @@
    @Authorization
    public ResultData updateConfig(@RequestBody TransactionEvent entity)
    {
        if(StringUtils.isEmpty(entity.getDepartmentId()))
        {
            return ResultData.error("部门id不能为空");
        }
        if(StringUtils.isEmpty(entity.getMatterName()))
        {
            return ResultData.error("事件名称不能为空");
        }
        return toAjax(iTransactionEventService.updateConfig(entity));
    }