|
@@ -7,8 +7,10 @@ import java.util.UUID;
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import com.jpsoft.bus.modules.bus.dto.StationStatusDTO;
|
|
|
+import com.jpsoft.bus.modules.bus.entity.PassengerInfo;
|
|
|
import com.jpsoft.bus.modules.bus.entity.VehicleInfo;
|
|
|
import com.jpsoft.bus.modules.bus.service.GpsService;
|
|
|
+import com.jpsoft.bus.modules.bus.service.PassengerInfoService;
|
|
|
import com.sun.xml.bind.v2.TODO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -30,6 +32,9 @@ public class ShiftInfoServiceImpl implements ShiftInfoService {
|
|
|
@Autowired
|
|
|
private GpsService gpsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private PassengerInfoService passengerInfoService;
|
|
|
+
|
|
|
@Override
|
|
|
public ShiftInfo get(String id) {
|
|
|
// TODO Auto-generated method stub
|
|
@@ -129,4 +134,26 @@ public class ShiftInfoServiceImpl implements ShiftInfoService {
|
|
|
public List<ShiftInfo> findByRouteIdAndStatusAndStartStationId(String routeId, String status, String startStationId) {
|
|
|
return shiftInfoDAO.findByRouteIdAndStatusAndStartStationId(routeId,status,startStationId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void finishShift(ShiftInfo shiftInfo) {
|
|
|
+
|
|
|
+
|
|
|
+ shiftInfo.setStatus("2");
|
|
|
+ shiftInfo.setFinishTime(new Date());
|
|
|
+ shiftInfo.setUpdateTime(new Date());
|
|
|
+ update(shiftInfo);
|
|
|
+
|
|
|
+ //修改当前班次下所有未下次乘客为下车状态
|
|
|
+ List<PassengerInfo> passengerInfoList = passengerInfoService.findByShiftIdAndStatus(shiftInfo.getId(),"1");
|
|
|
+ if (passengerInfoList.size()>0){
|
|
|
+ for (PassengerInfo passengerInfo : passengerInfoList){
|
|
|
+ passengerInfo.setStatus("2");
|
|
|
+ passengerInfo.setDownTime(new Date());
|
|
|
+ passengerInfo.setUpdateTime(new Date());
|
|
|
+ passengerInfo.setUpdateBy(shiftInfo.getUpdateBy());
|
|
|
+ passengerInfoService.update(passengerInfo);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|