| | |
| | | import cn.afterturn.easypoi.excel.ExcelExportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.xiaopeng.api.model.operation.XpElectronicFence; |
| | | import com.xiaopeng.api.model.operation.XpStation; |
| | | import com.xiaopeng.api.query.operation.XpStationQuery; |
| | | import com.xiaopeng.api.vo.account.LoginUser; |
| | |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | | import com.xiaopeng.common.security.service.TokenService; |
| | | import com.xiaopeng.map.exportExcel.XpStationExportExcel; |
| | | import com.xiaopeng.map.service.XpElectronicFenceService; |
| | | import com.xiaopeng.map.service.XpPointService; |
| | | import com.xiaopeng.map.service.XpStationService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private XpPointService xpPointService; |
| | | @Resource |
| | | private XpElectronicFenceService xpElectronicFenceService; |
| | | |
| | | |
| | | @ApiOperation(value = "场站管理已经启动列表", tags = {"管理后台-运营-场站管理"}) |
| | | @GetMapping("/findListEnable") |
| | | public R<List<XpStation>> findListEnable(@RequestParam String cityCode) { |
| | | |
| | | public R<List<XpStation>> findListByCityCode(@RequestParam String cityCode) { |
| | | XpStationQuery query = new XpStationQuery(); |
| | | query.setCityCode(cityCode); |
| | | return R.ok( xpStationService.findList(query)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "场站管理列表", tags = {"管理后台-运营-场站管理"}) |
| | | @PostMapping("/findList") |
| | | public R<List<XpStation>> findList(@RequestBody XpStationQuery query) { |
| | | List<XpStation> list = xpStationService.findList(query); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @ApiOperation(value = "场站管理分页列表", tags = {"管理后台-运营-场站管理"}) |
| | |
| | | XpStationVo beanVo = new XpStationVo(); |
| | | BeanUtils.copyProperties(bean, beanVo); |
| | | beanVo.setXpPointList(xpPointService.listByStationId(bean.getId())); |
| | | |
| | | XpElectronicFence electronicFence = xpElectronicFenceService.getById(bean.getElectronicId()); |
| | | |
| | | beanVo.setFenceEffectType(electronicFence.getEffectType()); |
| | | beanVo.setFenceEffectTime(electronicFence.getEffectTime()); |
| | | beanVo.setFenceFailureType(electronicFence.getFailureType()); |
| | | beanVo.setFenceFailureTime(electronicFence.getFailureTime()); |
| | | |
| | | return R.ok(beanVo); |
| | | } |
| | | |
| | |
| | | if(vo.getId() == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | xpStationService.validate(vo); |
| | | XpStation bean = xpStationService.getById(vo.getId()); |
| | | if(bean == null){ |
| | | return R.fail("参数错误"); |
| | | } |
| | | xpStationService.validate(vo); |
| | | //场站状态 0=草稿 1=待启用 2=启用中 3=已停用 4=失效 |
| | | if(bean.getStatus() == 2){ |
| | | return R.fail("场站在启动中不能编辑"); |
| | | } |
| | | // if(bean.getStatus() == 2){ |
| | | // return R.fail("场站在启动中不能编辑"); |
| | | // } |
| | | |
| | | LoginUser loginUser = tokenService.getLoginUser(); |
| | | |