|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletResponse; | 
|---|
|  |  |  | import java.util.*; | 
|---|
|  |  |  | import java.util.stream.Collectors; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @RequestMapping("/api") | 
|---|
|  |  |  | 
|---|
|  |  |  | return R.ok("Update Success").add(loc); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:loc:update')") | 
|---|
|  |  |  | @OperationLog("Update Loc") | 
|---|
|  |  |  | @PostMapping("/loc/update/many") | 
|---|
|  |  |  | public R updateMany(@RequestBody List<Loc> locList) { | 
|---|
|  |  |  | if (!Cools.isEmpty(locList)) { | 
|---|
|  |  |  | for (Loc loc : locList) { | 
|---|
|  |  |  | loc.setUpdateBy(getLoginUserId()); | 
|---|
|  |  |  | loc.setUpdateTime(new Date()); | 
|---|
|  |  |  | if (!locService.updateById(loc)) { | 
|---|
|  |  |  | return R.error("Update Fail"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok("Update Success").add(locList.stream().map(Loc::getId).collect(Collectors.toList())); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @PreAuthorize("hasAuthority('manager:loc:remove')") | 
|---|
|  |  |  | @OperationLog("Delete Loc") | 
|---|
|  |  |  | @PostMapping("/loc/remove/{ids}") | 
|---|