| | |
| | | import com.boying.common.R; |
| | | import com.boying.entity.OrderRecord; |
| | | import com.boying.entity.OutPark; |
| | | import com.boying.entity.Park; |
| | | import com.boying.entity.User; |
| | | import com.boying.entity.vo.OrderRecordVo; |
| | | import com.boying.service.OrderRecordService; |
| | |
| | | import com.boying.service.UserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/orderrecord") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/orderrecord" , name = "订单接口" ) |
| | | public class OrderRecordController { |
| | | |
| | | private final OrderRecordService orderRecordService; |
| | |
| | | */ |
| | | @ApiOperation(value = "分页查询", notes = "分页查询") |
| | | @PostMapping("/findPage" ) |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public R getOrderRecordPage(Page page, OrderRecord orderRecord) { |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(OrderRecord::getType,orderRecord.getType()) |
| | | .eq(OrderRecord::getStatus,1) |
| | | .eq(StringUtils.isNotBlank(orderRecord.getCarNo()),OrderRecord::getCarNo,orderRecord.getCarNo()) |
| | | .like(StringUtils.isNotBlank(orderRecord.getCarNo()),OrderRecord::getCarNo,orderRecord.getCarNo()) |
| | | .isNotNull(OrderRecord::getPayCode) |
| | | .orderByDesc(OrderRecord::getCreateTime); |
| | | Page page1 = orderRecordService.page(page, wrapper); |
| | |
| | | |
| | | |
| | | @PostMapping("/getByCarNo") |
| | | @Operation(summary = "通过车牌号月份分页查询" , description = "通过车牌号月份分页查询" ) |
| | | public Object getByCarNo(Page page,String carNo,String month,String phone) { |
| | | List<OrderRecordVo> recordVos = new ArrayList<>(); |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/findCountPage") |
| | | @Operation(summary = "查询停车场订单金额统计" , description = "查询停车场订单金额统计" ) |
| | | public Object findCountPage(Integer parkId,String startTime,String endTime) throws ParseException { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | QueryWrapper<OutPark> wrapper = new QueryWrapper<>(); |
| | |
| | | List<OutPark> value = objectListEntry.getValue(); |
| | | Double collect1 = value.stream().collect(Collectors.summingDouble(OutPark::getPrice)); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("parkName",parkService.getById(key).getName()); |
| | | Park byId = parkService.getById(key); |
| | | if(byId != null){ |
| | | map.put("parkName",byId.getName()); |
| | | }else { |
| | | map.put("parkName","未知停车场"); |
| | | } |
| | | map.put("orderNum",value.size()); |
| | | map.put("orderMoney",collect1); |
| | | resultList.add(map); |