| | |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.common.utils.NavigateSolution; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @ManagerAuth |
| | | public R add(BasMap basMap) { |
| | | basMapService.save(basMap); |
| | | if (basMap != null && basMap.getLev() != null) { |
| | | NavigateSolution.refreshMapCache(basMap.getLev()); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/basMap/update/auth") |
| | | @RequestMapping(value = "/basMap/update/auth") |
| | | @ManagerAuth |
| | | public R update(BasMap basMap){ |
| | | if (Cools.isEmpty(basMap) || null==basMap.getId()){ |
| | | return R.error(); |
| | | } |
| | | BasMap oldBasMap = basMapService.getById(basMap.getId()); |
| | | basMapService.updateById(basMap); |
| | | if (oldBasMap != null && oldBasMap.getLev() != null) { |
| | | NavigateSolution.clearMapCache(oldBasMap.getLev()); |
| | | } |
| | | Integer refreshLev = basMap.getLev() != null |
| | | ? basMap.getLev() |
| | | : oldBasMap == null ? null : oldBasMap.getLev(); |
| | | if (refreshLev != null) { |
| | | NavigateSolution.refreshMapCache(refreshLev); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @ManagerAuth |
| | | public R delete(@RequestParam(value="ids[]") Integer[] ids){ |
| | | for (Integer id : ids){ |
| | | BasMap basMap = basMapService.getById(id); |
| | | basMapService.removeById(id); |
| | | if (basMap != null && basMap.getLev() != null) { |
| | | NavigateSolution.clearMapCache(basMap.getLev()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.ok().add(levList); |
| | | } |
| | | |
| | | @PostMapping("/basMap/syncLocMast/auth") |
| | | @ManagerAuth(memo = "同步库位号和实际坐标") |
| | | public R syncLocMast(@RequestParam Integer lev) { |
| | | int updatedCount = basMapService.syncLocMastByMap(lev); |
| | | return R.ok("第" + lev + "层locType同步完成,更新" + updatedCount + "条库位数据"); |
| | | } |
| | | |
| | | @PostMapping("/basMap/crn/upload") |
| | | public R uploadExcel(@RequestParam("file") MultipartFile file) { |
| | | File tempFile = null; |