update 功能安全中心代码
This commit is contained in:
+2
-2
@@ -70,8 +70,8 @@ public class SafetyCenterController extends JeroController<SafetyCenter, SafetyC
|
|||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
@AutoLog(value = "功能安全中心-添加研究组")
|
@AutoLog(value = "功能安全中心-添加")
|
||||||
@ApiOperation(value = "功能安全中心-添加研究组", notes = "功能安全中心-添加")
|
@ApiOperation(value = "功能安全中心-添加", notes = "功能安全中心-添加")
|
||||||
@PostMapping(value = "/add")
|
@PostMapping(value = "/add")
|
||||||
public Result<String> add(@Validated @RequestBody SafetyCenter safetyCenter) {
|
public Result<String> add(@Validated @RequestBody SafetyCenter safetyCenter) {
|
||||||
safetyCenterService.add(safetyCenter);
|
safetyCenterService.add(safetyCenter);
|
||||||
|
|||||||
+5
-1
@@ -1,5 +1,6 @@
|
|||||||
package com.jero.functionalsafetycenter.service;
|
package com.jero.functionalsafetycenter.service;
|
||||||
|
|
||||||
|
import com.jero.common.exception.JeroBootException;
|
||||||
import com.jero.functionalsafetycenter.common.SafetyCenterCommon;
|
import com.jero.functionalsafetycenter.common.SafetyCenterCommon;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -15,7 +16,10 @@ import com.jero.functionalsafetycenter.mapper.SafetyCenterMapper;
|
|||||||
@Service
|
@Service
|
||||||
public class SafetyCenterService extends ServiceImpl<SafetyCenterMapper, SafetyCenter> {
|
public class SafetyCenterService extends ServiceImpl<SafetyCenterMapper, SafetyCenter> {
|
||||||
public void add(SafetyCenter safetyCenter) {
|
public void add(SafetyCenter safetyCenter) {
|
||||||
safetyCenter.setProjectType(SafetyCenterCommon.PROJECT_TYPE_2);
|
Integer projectType = safetyCenter.getProjectType();
|
||||||
|
if (projectType == null){
|
||||||
|
throw new JeroBootException("项目类型不能为空");
|
||||||
|
}
|
||||||
this.save(safetyCenter);
|
this.save(safetyCenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user