|
@@ -0,0 +1,39 @@
|
|
|
+package com.persagy.fm.sop.controller;
|
|
|
+
|
|
|
+import com.persagy.common.exception.BusinessException;
|
|
|
+import com.persagy.fm.sop.model.SopDTO;
|
|
|
+import com.persagy.fm.sop.service.ISopService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * sop api
|
|
|
+ * @author Charlie Yu
|
|
|
+ * @date 2021-03-05
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@Slf4j
|
|
|
+@RequestMapping("/sop/")
|
|
|
+public class SopController {
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ISopService sopService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存草稿
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/saveDraftSop")
|
|
|
+ public SopDTO saveDraftSop(@RequestBody SopDTO dto){
|
|
|
+ if(StringUtils.isAnyBlank(dto.getSopName())) {
|
|
|
+ throw new BusinessException("名称不能为空");
|
|
|
+ }
|
|
|
+ return sopService.insert(dto);
|
|
|
+ }
|
|
|
+}
|