|
|
@@ -1,20 +1,20 @@
|
|
|
package com.xintong.visualinspection.controller;
|
|
|
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-
|
|
|
-import javax.validation.Valid;
|
|
|
-
|
|
|
+import com.xintong.system.err.BusinessException;
|
|
|
+import com.xintong.visualinspection.bean.CheckItem;
|
|
|
+import com.xintong.visualinspection.bean.CheckRule;
|
|
|
+import com.xintong.visualinspection.service.CheckItemService;
|
|
|
+import com.xintong.visualinspection.service.ItemService;
|
|
|
+import com.xintong.visualinspection.util.CacheUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import com.xintong.system.err.BusinessException;
|
|
|
-import com.xintong.visualinspection.bean.CheckItem;
|
|
|
-import com.xintong.visualinspection.bean.CheckRule;
|
|
|
-import com.xintong.visualinspection.service.CheckItemService;
|
|
|
+import javax.validation.Valid;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* 文件名:CheckItemController
|
|
|
@@ -26,6 +26,8 @@ public class CheckItemController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private CheckItemService checkItemService;
|
|
|
+ @Autowired
|
|
|
+ private ItemService itemService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -38,6 +40,8 @@ public class CheckItemController extends BaseController {
|
|
|
@RequestMapping(value = "/add")
|
|
|
public String add(@Valid @RequestBody CheckItem checkItem){
|
|
|
checkItemService.insert(checkItem);
|
|
|
+ CacheUtil.refreshItemMap(itemService);
|
|
|
+ CacheUtil.refreshItemNameMap(itemService);
|
|
|
return super.returnSuccessResult("添加成功");
|
|
|
}
|
|
|
|
|
|
@@ -51,6 +55,8 @@ public class CheckItemController extends BaseController {
|
|
|
@RequestMapping(value = "/update")
|
|
|
public String update(@Valid @RequestBody CheckItem checkItem){
|
|
|
checkItemService.update(checkItem);
|
|
|
+ CacheUtil.refreshItemMap(itemService);
|
|
|
+ CacheUtil.refreshItemNameMap(itemService);
|
|
|
return super.returnSuccessResult("修改成功");
|
|
|
}
|
|
|
|
|
|
@@ -64,6 +70,8 @@ public class CheckItemController extends BaseController {
|
|
|
@RequestMapping(value = "/delete")
|
|
|
public String delete(@RequestBody CheckItem checkItem){
|
|
|
checkItemService.delete(checkItem.getId());
|
|
|
+ CacheUtil.refreshItemMap(itemService);
|
|
|
+ CacheUtil.refreshItemNameMap(itemService);
|
|
|
return super.returnSuccessResult("删除成功");
|
|
|
}
|
|
|
|