| | |
| | | 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.*; |
| | |
| | | @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)); |
| | | } |
| | | |
| | |
| | | @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)); |
| | | } |
| | | |