| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.controller.params.InitContainerParams; |
| | | import com.vincent.rsf.server.manager.entity.BasContainer; |
| | | import com.vincent.rsf.server.manager.entity.BasStation; |
| | | import com.vincent.rsf.server.manager.service.BasContainerService; |
| | |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<BasContainer, BaseParam> pageParam = new PageParam<>(baseParam, BasContainer.class); |
| | | PageParam<BasContainer, BaseParam> page = basContainerService.page(pageParam, pageParam.buildWrapper(true)); |
| | | for (BasContainer container : page.getRecords()) { |
| | | if (!Cools.isEmpty(container.getAreas())) { |
| | | String content = container.getAreas().substring(1, container.getAreas().length() - 1); |
| | | String[] parts = content.split(","); |
| | | Long[] longArray = new Long[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | longArray[i] = Long.parseLong(parts[i].trim()); |
| | | } |
| | | container.setAreaIds(longArray); |
| | | } |
| | | |
| | | } |
| | | // for (BasContainer container : page.getRecords()) { |
| | | // if (!Cools.isEmpty(container.getAreas())) { |
| | | // String content = container.getAreas().substring(1, container.getAreas().length() - 1); |
| | | // String[] parts = content.split(","); |
| | | // Long[] longArray = new Long[parts.length]; |
| | | // for (int i = 0; i < parts.length; i++) { |
| | | // longArray[i] = Long.parseLong(parts[i].trim()); |
| | | // } |
| | | // container.setAreaIds(longArray); |
| | | // } |
| | | // |
| | | // } |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 初始化 |
| | | * @return |
| | | */ |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @OperationLog("容器初始化") |
| | | @PostMapping("/basContainer/init/save") |
| | | public R init(@RequestBody InitContainerParams params) { |
| | | if (Objects.isNull(params)) { |
| | | return R.error("参数不能为空!!"); |
| | | } |
| | | return basContainerService.init(params, getLoginUserId()); |
| | | } |
| | | |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basContainer:list')") |
| | | @PostMapping("/basContainer/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |