| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | | import com.vincent.rsf.framework.exception.CoolException; |
| | | import com.vincent.rsf.server.common.utils.ExcelUtil; |
| | | import com.vincent.rsf.server.common.annotation.OperationLog; |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | |
| | | @OperationLog("Create 字典数据集") |
| | | @PostMapping("/dictData/save") |
| | | public R save(@RequestBody DictData dictData) { |
| | | if (Objects.isNull(dictData.getLabel())) { |
| | | throw new CoolException("别名不能为空!!"); |
| | | } |
| | | if (Objects.isNull(dictData.getValue())) { |
| | | throw new CoolException("值不能为空!!"); |
| | | } |
| | | if (Objects.isNull(dictData.getDictTypeCode())) { |
| | | throw new CoolException("编码不能为空!!"); |
| | | } |
| | | if (Objects.isNull(dictData.getDictTypeId())) { |
| | | throw new CoolException("主单ID不能为空!!"); |
| | | } |
| | | dictData.setCreateBy(getLoginUserId()); |
| | | dictData.setCreateTime(new Date()); |
| | | dictData.setUpdateBy(getLoginUserId()); |
| | | dictData.setUpdateTime(new Date()); |
| | | if (!dictDataService.save(dictData)) { |
| | | return R.error("Save Fail"); |
| | | } |