|
@@ -129,13 +129,10 @@ public class CenterdataTAttachController extends BaseController {
|
|
|
return R.ok(centerdataTAttachMapper.urlAttchMpF(busId));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- @GetMapping("/insertAttachToArray")
|
|
|
- public int insertAttachToArray(@RequestParam("jsonStr") String jsonStr) {
|
|
|
- JSONObject obj = JSONObject.parseObject(jsonStr);
|
|
|
- List<CenterdataTAttach> array = obj.getObject("attachList",List.class);
|
|
|
- String busId = obj.getString("busId");
|
|
|
- centerdataTAttachService.deleteCenterdataTAttachByBusId(busId);
|
|
|
- return centerdataTAttachService.insertListCenterdataTAttach(array);
|
|
|
+ @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));
|
|
|
}
|
|
|
}
|