| | |
| | | if(c.getTimeInMillis() > sdf.parse(day).getTime()){ |
| | | throw new SystemException("日期不能小于当天"); |
| | | } |
| | | |
| | | Boolean chooseSeat = false; |
| | | if (driverId != null) { |
| | | Integer chooseSeatValue = lineSiteMapper.queryChooseSeatByDriverId(driverId); |
| | | chooseSeat = (chooseSeatValue != null && chooseSeatValue.intValue() == 1); |
| | | } |
| | | |
| | | if (lineId != null && lineId < 0) { |
| | | return lineSiteMapper.queryDriverBySelfTripId(Math.abs(lineId), sdf.parse(day), driverId); |
| | | List<Map<String, Object>> result = lineSiteMapper.queryDriverBySelfTripId(Math.abs(lineId), sdf.parse(day), driverId); |
| | | for (Map<String, Object> map : result) { |
| | | map.put("chooseSeat", chooseSeat); |
| | | } |
| | | return result; |
| | | } |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | List<LineShift> lineShifts = lineShiftMapper.queryByLineId(lineId); |
| | |
| | | String content = map.get("content").toString(); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | map.put("price", jsonObject.getString("num1")); |
| | | if (chooseSeat){ |
| | | map.put("chooseSeat", chooseSeat); |
| | | }else if (driverId == null){ |
| | | Integer chooseSeatValue = lineSiteMapper.queryChooseSeatByDriverId(Integer.parseInt(map.get("driverId").toString())); |
| | | map.put("chooseSeat", chooseSeatValue != null && chooseSeatValue.intValue() == 1); |
| | | } |
| | | data = map; |
| | | list.add(data); |
| | | } |
| | |
| | | if(b){ |
| | | data.put("id", lineShift.getId()); |
| | | data.put("startTime", lineShift.getStartTime() + "-" + lineShift.getEndTime()); |
| | | data.put("chooseSeat", chooseSeat); |
| | | list.add(data); |
| | | } |
| | | } |