|
@@ -3,9 +3,11 @@ package com.ruoyi.web.controller.system;
|
|
|
import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.ruoyi.system.domain.PoCollection;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.PutMapping;
|
|
@@ -78,8 +80,11 @@ public class PoIssuerController extends BaseController
|
|
|
@Log(title = "新增发行人", businessType = BusinessType.INSERT)
|
|
|
@ApiOperation("新增发行人")
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody PoIssuer poIssuer)
|
|
|
+ public AjaxResult add(@Validated @RequestBody PoIssuer poIssuer)
|
|
|
{
|
|
|
+ List<PoIssuer> poIssuerList = poIssuerService.selectPoIssuerList(poIssuer);
|
|
|
+ if (poIssuerList != null && !poIssuerList.isEmpty())
|
|
|
+ return error("重复的发行人");
|
|
|
return toAjax(poIssuerService.insertPoIssuer(poIssuer));
|
|
|
}
|
|
|
|
|
@@ -92,6 +97,10 @@ public class PoIssuerController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody PoIssuer poIssuer)
|
|
|
{
|
|
|
+ PoIssuer poIssuer1 = poIssuerService.selectPoIssuerByIssuerId(poIssuer.getIssuerId());
|
|
|
+ if (poIssuer1 == null)
|
|
|
+ return error("要修改的发行人不存在");
|
|
|
+ poIssuer.setUpdateBy(getUsername());
|
|
|
return toAjax(poIssuerService.updatePoIssuer(poIssuer));
|
|
|
}
|
|
|
|