|
@@ -124,13 +124,18 @@ public class MaterialInfoController {
|
|
|
|
|
|
/**
|
|
|
* 修改名称
|
|
|
- * @param id
|
|
|
- * @param name
|
|
|
+ * @param data
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/editName")
|
|
|
- public Map<String, Object> editName(String id,String name) {
|
|
|
+ public Map<String, Object> editName(@RequestBody JSONObject data) {
|
|
|
Map<String,Object>result = new HashMap<>();
|
|
|
+ String id = data.getString("id");
|
|
|
+ String name = data.getString("name");
|
|
|
+ if(null == id||"".equals(id.trim())||null == name||"".equals(name.trim())){
|
|
|
+ ResultMapUtils.setResultMap(result,StatusCode.COMMON_PARAM_ERROR);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
MaterialInfo info = materialInfoService.getById(id);
|
|
|
if(null == info){
|
|
|
ResultMapUtils.setResultMap(result,StatusCode.COMMON_DATA_NOT_EXIST);
|