浏览代码

Merge branch 'dev' into dev-2.0

lyq 1 年之前
父节点
当前提交
82714ba297

+ 8 - 0
src/main/java/com/sooka/sponest/data/system/attach/controller/CenterdataTAttachController.java

@@ -1,5 +1,6 @@
 package com.sooka.sponest.data.system.attach.controller;
 
+import com.alibaba.fastjson.JSONObject;
 import com.ruoyi.common.core.domain.R;
 import com.ruoyi.common.core.web.controller.BaseController;
 import com.ruoyi.common.core.web.domain.AjaxResult;
@@ -127,4 +128,11 @@ public class CenterdataTAttachController extends BaseController {
     public R<List<CenterdataTAttach>> urlAttchMpF(@PathVariable String busId) {
         return R.ok(centerdataTAttachMapper.urlAttchMpF(busId));
     }
+
+    @PostMapping("/delAndInsertBatch")
+    public R delAndInsertBatch(@RequestParam("jsonStr") String jsonStr) {
+        List<CenterdataTAttach> attaches = JSONObject.parseArray(jsonStr, CenterdataTAttach.class);
+        centerdataTAttachService.deleteCenterdataTAttachByBusId(attaches.get(0).getBusId());
+        return R.ok(centerdataTAttachService.insertListCenterdataTAttach(attaches));
+    }
 }