md
This commit is contained in:
parent
c2f6930248
commit
63c66050c3
@ -14,6 +14,7 @@ package com.xdadan.erp.web.emis;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -105,9 +106,13 @@ public class EmisMaterialController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('emis:emisMaterial:add')")
|
||||
@Log(title = "物料类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody EmisMaterial emisMaterial)
|
||||
{
|
||||
return toAjax(emisMaterialService.insertEmisMaterial(emisMaterial));
|
||||
public AjaxResult add(@RequestBody EmisMaterial emisMaterial) {
|
||||
try {
|
||||
return toAjax(emisMaterialService.insertEmisMaterial(emisMaterial));
|
||||
} catch (DuplicateKeyException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("数据重复!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -118,7 +123,12 @@ public class EmisMaterialController extends BaseController
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody EmisMaterial emisMaterial)
|
||||
{
|
||||
return toAjax(emisMaterialService.updateEmisMaterial(emisMaterial));
|
||||
try {
|
||||
return toAjax(emisMaterialService.updateEmisMaterial(emisMaterial));
|
||||
} catch (DuplicateKeyException e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.error("数据重复!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user