|
|
@@ -7,9 +7,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.util.HashMap;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* @author tianx
|
|
|
@@ -24,30 +24,21 @@ public class CarInoutRecordServiceImpl extends ServiceImpl<CarInoutRecordMapper,
|
|
|
private CarInoutRecordMapper CarInoutRecordMapper;
|
|
|
|
|
|
@Override
|
|
|
- public Map<Integer, List<CarInoutRecord>> getCarInRecordsByDateGroupByWhiteList(CarInoutRecord record) {
|
|
|
- HashMap<Integer, List<CarInoutRecord>> map = new HashMap<>();
|
|
|
+ public List<String> getCarInRecordsByDateGroupByWhiteList(CarInoutRecord record) {
|
|
|
+ List<String> carInRecordCount = new ArrayList<>();
|
|
|
+ carInRecordCount.add(record.getTimeStamp().format(DateTimeFormatter.ofPattern("MM-dd")));
|
|
|
// 免费车
|
|
|
Integer free = 2;
|
|
|
// 临时车
|
|
|
Integer temp = 1;
|
|
|
- // 入库
|
|
|
- Integer in = 1;
|
|
|
-// CarInoutRecord freeRecord = new CarInoutRecord();
|
|
|
-// freeRecord.setWhitelistType(free);
|
|
|
-// freeRecord.setDirection(in);
|
|
|
-// freeRecord.setTimeStamp(record.getTimeStamp());
|
|
|
record.setWhitelistType(free);
|
|
|
List<CarInoutRecord> freeList = CarInoutRecordMapper.getCarInRecordsByDateGroupByWhiteList(record);
|
|
|
System.out.println(freeList.getClass());
|
|
|
- map.put(free, freeList);
|
|
|
-// CarInoutRecord tempRecord = new CarInoutRecord();
|
|
|
-// tempRecord.setWhitelistType(temp);
|
|
|
-// tempRecord.setDirection(in);
|
|
|
-// tempRecord.setTimeStamp(record.getTimeStamp());
|
|
|
+ carInRecordCount.add(freeList.size() + "");
|
|
|
record.setWhitelistType(temp);
|
|
|
List<CarInoutRecord> tempList = CarInoutRecordMapper.getCarInRecordsByDateGroupByWhiteList(record);
|
|
|
- map.put(temp, tempList);
|
|
|
- return map;
|
|
|
+ carInRecordCount.add(tempList.size() + "");
|
|
|
+ return carInRecordCount;
|
|
|
}
|
|
|
}
|
|
|
|