| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.chargingPile.api.dto.GetSiteListDTO; |
| | | import com.ruoyi.chargingPile.api.feignClient.PartnerClient; |
| | | import com.ruoyi.chargingPile.api.feignClient.SiteClient; |
| | | import com.ruoyi.chargingPile.api.model.TParkingLot; |
| | | import com.ruoyi.chargingPile.api.model.TParkingRecord; |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.log.enums.OperatorType; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.annotation.Logical; |
| | | import com.ruoyi.common.security.annotation.RequiresPermissions; |
| | | import com.ruoyi.order.api.query.TOrderInvoiceQuery; |
| | | import com.ruoyi.order.api.vo.TCharingUserEquimentVO; |
| | | import com.ruoyi.order.api.vo.TOrderInvoiceVO; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | private SiteClient siteClient; |
| | | @Resource |
| | | private TokenService tokenService; |
| | | @Resource |
| | | private PartnerClient partnerClient; |
| | | |
| | | @Resource |
| | | private SysUserClient sysUserClient; |
| | | @RequiresPermissions(value = {"/parkingRecord"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "列表") |
| | | @PostMapping(value = "/page") |
| | | public R<Page<TParkingRecord>> page(@RequestBody ParkingRecordPageQuery query) { |
| | |
| | | for (GetSiteListDTO datum : data) { |
| | | siteIds.add(datum.getId()); |
| | | } |
| | | List<TParkingLot> list = parkingLotService.lambdaQuery().in(!siteIds.isEmpty(), TParkingLot::getSiteId, siteIds).list(); |
| | | if (siteIds.isEmpty()){ |
| | | siteIds.add(-1); |
| | | } |
| | | List<TParkingLot> list = parkingLotService.lambdaQuery().in( TParkingLot::getSiteId, siteIds).list(); |
| | | List<Integer> ids = new ArrayList<>(); |
| | | for (TParkingLot tParkingLot : list) { |
| | | ids.add(tParkingLot.getId()); |
| | |
| | | .between(query.getTimePeriod()!=null,TParkingRecord::getOutParkingTime,s1,s2) |
| | | .orderByDesc(TParkingRecord::getCreateTime) |
| | | .page(Page.of(query.getPageCurr(), query.getPageSize())); |
| | | |
| | | SysUser sysUser = sysUserClient.getSysUser(tokenService.getLoginUser().getUserid()).getData(); |
| | | Integer roleType = sysUser.getRoleType(); |
| | | for (TParkingRecord record : page.getRecords()) { |
| | | TParkingLot byId = parkingLotService.getById(record.getParkingLotId()); |
| | | record.setUid(record.getId().toString()); |
| | | if (byId!=null) { |
| | | record.setParkName(byId.getName()); |
| | | if (roleType==2){ |
| | | List<Boolean> data1 = partnerClient.parkingRecordListMenu(sysUser.getObjectId(), byId.getSiteId()).getData(); |
| | | record.setAuthInfo(data1.get(0)); |
| | | record.setAuthInfo(data1.get(1)); |
| | | } |
| | | } |
| | | } |
| | | return R.ok(page); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingPaymentOrder"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "停车缴费订单列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<TParkingRecordPageInfoVO> pageList(@RequestBody ParkingRecordQuery query) { |
| | | return R.ok(parkingRecordService.pageList(query)); |
| | | } |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingPaymentOrder/export"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "导出") |
| | | @PutMapping("/export") |
| | | @Log(title = "【停车记录】导出停车记录", businessType = BusinessType.EXPORT,operatorType = OperatorType.MANAGE) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "详情") |
| | | @GetMapping(value = "/detail") |
| | | public R<TParkingRecord> detail(Long id) { |
| | | return R.ok(parkingRecordService.getById(id)); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingRecord/already_appeared"}, logical = Logical.OR) |
| | | @ApiOperation(tags = {"后台-订单管理-停车记录"},value = "出场") |
| | | @GetMapping(value = "/out") |
| | | @Log(title = "【停车记录】修改出场状态", businessType = BusinessType.UPDATE,operatorType = OperatorType.MANAGE) |
| | |
| | | public void addParkingRecord(@RequestBody TParkingRecord parkingRecord){ |
| | | parkingRecordService.save(parkingRecord); |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/parkingOperationAnalysis"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/data") |
| | | @ApiOperation(value = "统计", tags = {"管理后台-数据分析-车场运营分析"}) |
| | |
| | | return R.ok(tParkLotRecordVO); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private static Map<String, Object> findMapWithTimeValue(List<Map<String, Object>> charMap1,String timeValue) { |
| | | for (Map<String, Object> map : charMap1) { |
| | | if (map.containsKey("time") && map.get("time").equals(timeValue)) { |
| | |
| | | } |
| | | return null; // 如果没有找到,返回 null |
| | | } |
| | | |
| | | |
| | | |
| | | private Map<String, Object> findMapWithDateValue(List<Map<String, Object>> list, String date) { |
| | | for (Map<String, Object> map : list) { |
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/work") |
| | | @ApiOperation(value = "停车订单统计", tags = {"管理后台-工作台"}) |
| | |
| | | return R.ok(tParkLotRecordCountVo); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/work1") |
| | | @ApiOperation(value = "停车订单统计", tags = {"管理后台-工作台"}) |
| | |
| | | return R.ok(tParkLotRecordCountVo); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequiresPermissions(value = {"/workbench"}, logical = Logical.OR) |
| | | @ResponseBody |
| | | @PostMapping(value = "/parking/income") |
| | | @ApiOperation(value = "停车收入统计", tags = {"管理后台-工作台"}) |