| | |
| | | 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.entity.BasStation; |
| | | import com.vincent.rsf.server.manager.entity.BasStationArea; |
| | | import com.vincent.rsf.server.manager.service.BasStationAreaService; |
| | | import com.vincent.rsf.server.manager.service.impl.BasStationServiceImpl; |
| | | import com.vincent.rsf.server.manager.utils.buildPageRowsUtils; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private BasStationAreaService basStationAreaService; |
| | | @Autowired |
| | | private BasStationServiceImpl basStationService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:list')") |
| | | @PostMapping("/basStationArea/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<BasStationArea, BaseParam> pageParam = new PageParam<>(baseParam, BasStationArea.class); |
| | | return R.ok().add(basStationAreaService.page(pageParam, pageParam.buildWrapper(true))); |
| | | PageParam<BasStationArea, BaseParam> page = basStationAreaService.page(pageParam, pageParam.buildWrapper(true)); |
| | | buildPageRowsUtils.userNameMap(page.getRecords()); |
| | | return R.ok().add(page); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:basStationArea:list')") |
| | |
| | | basStationArea.setCreateTime(new Date()); |
| | | basStationArea.setUpdateBy(getLoginUserId()); |
| | | basStationArea.setUpdateTime(new Date()); |
| | | List<String> objects = new ArrayList<>(); |
| | | for (String station: basStationArea.getStationAlias()) { |
| | | long parseLong = Long.parseLong(station); |
| | | BasStation byId = basStationService.getById(parseLong); |
| | | objects.add(byId.getStationName()); |
| | | } |
| | | basStationArea.setStationAliasStaNo(objects); |
| | | if (!basStationAreaService.save(basStationArea)) { |
| | | return R.error("Save Fail"); |
| | | } |