|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.gyee.sampleimpala.common.result.JsonResult;
|
|
|
import com.gyee.sampleimpala.common.result.ResultCode;
|
|
|
import com.gyee.sampleimpala.model.kudu.Casefault;
|
|
|
+import com.gyee.sampleimpala.model.kudu.Casefaultalg;
|
|
|
import com.gyee.sampleimpala.service.kudu.CasefaultService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -29,24 +30,24 @@ public class CaseFaultController {
|
|
|
* @param widget 故障部件
|
|
|
* @param st 开始时间
|
|
|
* @param et 结束时间
|
|
|
+ * @param ids oracle关联的faultid
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/fault/all")
|
|
|
- public JSONObject stationAll(String station, String[] model, String[] widget,
|
|
|
- String st, String et){
|
|
|
- List<Casefault> list = casefaultService.getAll(station, model, widget, st, et);
|
|
|
+ public JSONObject faultAll(String station, String[] model, String[] widget,
|
|
|
+ String st, String et, String[] ids){
|
|
|
+ List<Casefault> list = casefaultService.getAll(station, model, widget, st, et, ids);
|
|
|
return JsonResult.successData(ResultCode.SUCCESS, list);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 新增样本案例
|
|
|
- * @param obj
|
|
|
+ * 批量新增或修改数据
|
|
|
+ * @param list
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/item/insert")
|
|
|
- public JSONObject stationInsert(@RequestBody Casefault obj){
|
|
|
- boolean flag = casefaultService.insertItem(obj);
|
|
|
+ @PostMapping("/fault/insert")
|
|
|
+ public JSONObject faultInsert(@RequestBody List<Casefault> list){
|
|
|
+ boolean flag = casefaultService.insertOrUpdate(list);
|
|
|
if (flag){
|
|
|
return JsonResult.success(ResultCode.SUCCESS);
|
|
|
}
|
|
@@ -54,6 +55,21 @@ public class CaseFaultController {
|
|
|
return JsonResult.error(ResultCode.ERROR);
|
|
|
}
|
|
|
|
|
|
+// /**
|
|
|
+// * 新增样本案例
|
|
|
+// * @param obj
|
|
|
+// * @return
|
|
|
+// */
|
|
|
+// @PostMapping("/item/insert")
|
|
|
+// public JSONObject faultInsert(@RequestBody Casefault obj){
|
|
|
+// boolean flag = casefaultService.insertItem(obj);
|
|
|
+// if (flag){
|
|
|
+// return JsonResult.success(ResultCode.SUCCESS);
|
|
|
+// }
|
|
|
+//
|
|
|
+// return JsonResult.error(ResultCode.ERROR);
|
|
|
+// }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 编辑样本案例
|
|
@@ -61,7 +77,7 @@ public class CaseFaultController {
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/item/edit")
|
|
|
- public JSONObject stationEdit(@RequestBody Casefault obj){
|
|
|
+ public JSONObject faultEdit(@RequestBody Casefault obj){
|
|
|
System.out.println(obj.toString());
|
|
|
boolean flag = casefaultService.editItem(obj);
|
|
|
if (flag){
|
|
@@ -79,7 +95,7 @@ public class CaseFaultController {
|
|
|
*/
|
|
|
@PostMapping("/item/delete")
|
|
|
@ResponseBody
|
|
|
- public JSONObject stationDelete(String id){
|
|
|
+ public JSONObject faultDelete(String id){
|
|
|
boolean flag = casefaultService.deleteItem(id);
|
|
|
if (flag){
|
|
|
return JsonResult.success(ResultCode.SUCCESS);
|
|
@@ -88,7 +104,4 @@ public class CaseFaultController {
|
|
|
return JsonResult.error(ResultCode.ERROR);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|